JSON input
Paste JSON, optionally name the root type, then generate.
Your C struct code will appear here.
Convert JSON into C structs. Strings become char buffers, numbers become int or double, arrays become pointers, and nested structs are declared in order.
Paste JSON, optionally name the root type, then generate.
Your C struct code will appear here.
C needs fixed memory layouts, so the generator maps JSON's dynamic types onto buffers, ints, doubles, and pointers. The result is a plain old data struct you can memcpy, serialize, or send over a socket.
The default char buffer sizes are starting points. Measure your longest real strings and shrink the buffers to match, which matters on memory constrained embedded targets.