cJSON is an ultralightweight JSON parser written in ANSI C.
The tool addresses the need for minimal JSON parsing in C environments where dependencies must be kept to a bare minimum. It parses JSON strings into a tree data structure and can serialize that structure back to JSON text. The parser handles basic JSON types including objects, arrays, strings, numbers, booleans, and null values. It operates in two modes: automatic parsing that handles the entire process, and manual mode for more granular control over data structure traversal and manipulation.
cJSON suits embedded systems, microcontrollers, and other resource-constrained environments where a full-featured JSON library would be excessive. The entire implementation consists of a single C source file and a single header file, making integration straightforward—developers can simply copy these two files into their project. The library is written in ANSI C to maximize compatibility across platforms and compilers. It is appropriate for projects where simplicity and minimal footprint take priority over advanced features. The README emphasizes that cJSON aims to be the simplest possible parser that gets the job done without getting in the way.
The project maintains a focused scope with documentation covering caveats around zero characters, character encoding, floating-point number handling, deep nesting limits, thread safety considerations, case sensitivity, and duplicate object member behavior. The tool can be built and integrated through multiple methods including direct source copying, CMake, Makefile, Meson, and Vcpkg, providing flexibility for different build environments.