Online developer tool
JSON to C Array/Struct Converter
Paste JSON and get a matching C typedef struct plus an initialized variable, with JSON keys mapped to snake_case field names.
JSON input
How to use this converter
Purpose
Use this tool to turn a JSON config or payload into a matching C struct definition and initializer, so you can copy config data straight into firmware without hand-writing the struct.
Main steps
- 1Paste or type a JSON object into the left panel. The root value must be an object, not an array or a plain value.
- 2Optionally set the struct type name and variable name used in the generated code.
- 3The C code on the right updates automatically: a typedef struct definition followed by a designated initializer.
- 4Nested objects become their own typedef struct, declared above the struct that uses them. Arrays of numbers, strings, booleans, or objects become fixed-size C arrays.
- 5Check the warnings panel for fields that could not be converted, such as empty or mixed-type arrays, and copy the result once it looks right.
Client-side only · nothing is uploaded
C code
Enter a JSON object to generate C code.