JSON to Types help
Turn a JSON example into typed interfaces or structs.
Steps
- Paste a representative JSON value.
- Choose TypeScript or Go, and set the root type name.
- Copy the output.
How it infers
- Arrays of objects are merged into one shape; a field missing from some items becomes optional (
?in TS, a pointer withomitemptyin Go). nullalongside a value produces a nullable type.- Nested objects get their own named interface / struct.
Notes
- It is a best effort from one sample; widen or narrow the types by hand as needed.
- Nothing is uploaded.
Everything runs in your browser. Nothing you enter or drop is uploaded.
Back to JSON to Types