json-build
FreeA tiny, zero-allocation JSON serializer written in ANSI C. A good fit for development in memory constrained systems.
About json-build
json-build is a tiny, zero-allocation JSON serializer written in ANSI C, designed for memory-constrained systems. It is compatible with C89, has no dependencies, and does not use dynamic memory allocation by default. The library provides a simple builder API for constructing JSON objects, arrays, strings, numbers, booleans, and null values. It also includes automatic buffer management functions (_auto) that reallocate the buffer when needed. json-build is a single-header, header-only library that can be included with just one file. It is the serialization counterpart to jsmn-find, a tokenizer. Ideal for embedded systems and environments where minimal resource usage is critical.
Key Features
Pros & Cons
- Zero dynamic memory allocation (avoids heap fragmentation)
- Small code footprint suitable for resource-limited devices
- No external dependencies, easy to integrate
- C89 compatibility works with legacy compilers
- Optional automatic buffer management for convenience
- Only provides JSON serialization (no parsing built-in; uses a separate tokenizer jsmn-find)
- Manual buffer management can be error-prone without _auto functions
- Limited to building JSON; does not support validation or pretty-printing out of the box