A minimalistic, single-header JSON tokenizer/parser in C for resource-limited and embedded systems.
jsmn is a minimalistic JSON tokenizer and parser implemented in C. It provides a lightweight solution for parsing JSON data in environments with limited resources, such as embedded systems or microcontrollers, by avoiding dynamic memory allocation and keeping the code footprint extremely small.
Developers working on embedded systems, IoT devices, or any C project where memory and processing power are constrained and a full-featured JSON library is overkill.
Developers choose jsmn for its unparalleled simplicity, zero dependencies, and tiny code size, making it the fastest and most portable JSON parser for C in resource-limited scenarios without sacrificing robustness.
Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Compatible with C89 and requires no standard library, as stated in the features, making it run on everything from x86 to AVR microcontrollers.
At about 200 lines of code with only two API functions, it drastically reduces memory usage and binary size for embedded projects.
Uses static token arrays to avoid heap memory, preventing fragmentation and ensuring predictable performance in resource-constrained environments.
Supports single-pass parsing for streaming data, allowing efficient handling of JSON in chunks without storing the entire input.
Tokens only point to positions in the JSON string, forcing developers to write additional code to extract and interpret values, which increases complexity.
Error codes like JSMN_ERROR_INVAL are basic and provide little detail on JSON syntax issues, making debugging more difficult.
Lacks functionality to generate JSON from C data structures, restricting it to parsing-only use cases without external tools.