JSON to TypeScript
Paste a JSON payload to get ready-to-use TypeScript interfaces. Nested objects and arrays become named types, and keys that are not valid identifiers are quoted automatically.
Free Runs locally No signup
JSON input
TypeScript output
TypeScript interfaces will appear here.
Nested objects and arrays are converted automatically.
How to use it
1
Paste your JSON
Drop a JSON object or array into the input panel.
2
Name the root type
Set the root interface name and choose interface or type.
3
Copy or download
The TypeScript output updates as you type.
Why use this tool
Nested types get names
Nested objects and arrays produce readable, reusable interfaces.
Handles awkward keys
Keys with dashes, spaces or leading digits are quoted correctly.
Runs locally
Your payload never leaves the browser.
Frequently asked questions
Does it infer optional properties?
No. JSON cannot describe optional fields, so every property is marked required. Remove or mark fields manually when an API can omit them.
How are arrays typed?
Arrays use the first item to infer the element type. Empty arrays become unknown[], and mixed primitive arrays become unions.
Can I use type instead of interface?
Yes. Switch the declaration control to type and the generator uses type aliases.
What about null?
Null values become null. If a field can also be a string, use a union such as string | null after generating.
Are my payloads uploaded?
No. Parsing and generation happen in your browser.
Related tools
Developer Tools JSON Formatter & Validator Format, validate and minify JSON in your browser. Choose 2 or 4-space indentation, sort keys, and copy the result instantly. Free, private, no signup. Developer Tools JSON to CSV Converter Convert JSON arrays to CSV and CSV back to JSON in your browser. Handle quotes, delimiters and nested values, then copy or download the result. Developer Tools YAML to JSON Converter Convert YAML to JSON and JSON to YAML in your browser. Keep nested structures, choose the indent size and see YAML errors with a line number. Developer Tools Base64 Encoder & Decoder Encode text to Base64 or decode Base64 back to text, with full UTF-8 and URL-safe support. Runs locally in your browser — no upload, no signup. Developer Tools Hash Generator Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes from text in your browser. Compare digests and copy them instantly. Developer Tools JWT Decoder Decode a JSON Web Token to inspect its header, payload, signature and expiry claims. Nothing is uploaded and no signature is trusted.
Last updated: