Description
LwJSON is a generic JSON parser library written in C for embedded systems. It supports two parsing styles. Streaming parsing is aimed at very small microcontrollers, while classic parsing keeps the full JSON data in one linear block of memory and suits PC applications or devices with several kilobytes of RAM to spare. The library is written for C11 and uses standard integer types. Token allocation is static, with optional dynamic pre-allocation by the application, and the parser avoids recursion, uses no malloc or free calls, and returns zero-copy results. Its functions are re-entrant. The project also includes a separate JSON serializer that writes into a fixed buffer or sends chunks through a callback, optional 64-bit integer output, string escape and unescape helpers, and macros for matching nested structures when streaming. The README says the parser follows RFC 4627 and RFC 8259, and that its test coverage is available in the repository. Contributors are asked to fork the repository, follow the C style, format with clang-format and open pull requests against the develop branch.…
Highlights
- Streaming and classic JSON parsing modes
- No malloc, free or recursion in the parser
- Separate serializer with fixed-buffer or callback output
- RFC 4627 and RFC 8259 compliant
- Optional inline comment support
Ratings & Reviews
No ratings yet
Be the first to rate Lwjson.
People also visit
Lwjson FAQ
What is LwJSON?
It is a JSON parser library in C, designed for embedded systems and microcontrollers, and it also works on larger PC targets.
How do I choose a parsing mode?
Use streaming parsing on very small microcontrollers. Use classic parsing when the whole JSON text can sit in memory, such as on a PC or a device with several kilobytes of RAM.
Does it allocate memory?
The parser does not call malloc or free. It uses static token allocation, with an optional application-provided pre-allocation.
What license is it under?
The README describes its license as MIT.
How can I contribute?
Fork the GitHub repository, follow the C style rules and format with clang-format, then open a pull request against the develop branch. You can also report bugs or request features through issues.
What are the best Lwjson alternatives?
Popular alternatives to Lwjson include Oboe.js, Lowdb and JSONCrush. See all Lwjson alternatives

