Turn JSON into Go, TypeScript, PHP or Python types
Type inference that merges across array items, so one null field does not collapse the whole property into any.
How JSON to Struct works
Parsers and formatters run as JavaScript on the source you pasted. That is why a large document can freeze the tab for a moment — the work is genuinely happening here, not on a server. Configuration files and private keys therefore never leave your machine to be formatted.
That is the whole architecture: static files, one script, no upload endpoint to leak or log. Close the tab and the work is gone.
Good to know
- Works offline once loaded, including on flights and in locked-down networks.
- No file size limit beyond your device's own memory.
- Free to use, with no account and no usage counter.
- Results are produced locally, so they are not logged or shared with anyone.
Questions
How are numbers typed?
Integers become int (or number/float), anything with a decimal becomes float64/number/float. A field that is sometimes 1 and sometimes 1.5 will be typed as the first value seen in the array — check it.
What happens with null values?
A lone null widens the type to interface{}/unknown/mixed, because the sample gives no information about what will arrive later.
Are JSON keys renamed?
No. Go and Python get a sanitised field name plus the original key in the tag or comment, so nothing is silently lost.
Is my JSON sent anywhere?
No — parsing and code generation happen in the page.
Keep going
More developer tools
CSV to SQL
Paste CSV and get batched INSERT statements with quotes escaped and empty cells turned into NULL. Choose the table name and rows per statement.
Open toolJSON Formatter
Format, validate and minify JSON with precise error messages. Everything runs locally in your browser.
Open toolRegex Tester
Test regular expressions live with highlighted matches, capture groups and a replace preview.
Open toolCron Parser
Turn a five-field cron expression into a readable description with the next five scheduled runs in your timezone.
Open toolHTML Formatter
Indent nested HTML so the structure is readable, without changing any markup.
Open toolCSS Minifier
Strip comments and whitespace from CSS and see exactly how many bytes you saved.
Open tool