Inference rulesNested objects split into separate types; arrays are typed automatically; optional/nullable fields detected; mixed types form unions; null / empty arrays fall back to sane types; identical shapes are deduped and name clashes disambiguated.Runs locally — no fixed size limit (bounded by browser memory)
Sample JSONJSON
Paste or type JSON
GeneratedC++
Paste or type JSON
JSON → struct · Local · No upload

JSON to C++ Struct Generator

Sample JSON → struct · Standard library types · optional · Includes on demand

🔒Processed locally in your browser — never uploaded or stored

No upload, no storage

JSON is processed in memory and never sent to a server.

Share via URL fragment

Share links encode data in the # anchor — never sent to a server.

Remember last edit

Optionally keep your last input locally; clear it with one click.

Generate C++ Structs from JSON|Standard Library Types Only|std::optional for Nullable|Includes on Demand|Runs Locally

Generate Structs

Nested objects split into separate structs, emitted so referenced types come first — it compiles in the order you get it.

Standard Library Only

Types land on std::string, std::vector and std::int64_t. No framework lock-in.

Includes on Demand

Only headers you actually use get written — no block of dead includes to trim.

optional for Nullable

Missing and nullable fields are wrapped in std::optional, which says more than a bare pointer.

Runs Locally — No Upload

Generation runs in your browser; data is never uploaded.