Output appears here...How to use
Paste a representative sample
Use a real API response if you can, since types are inferred from exactly what you paste. Try sample loads a small object with nesting to demonstrate.
Name the root and generate
Type a name into the Root name field, then press Generate types. The output is one exported interface describing the entire structure, nested parts included.
Paste into your project
Copy the interface into a .ts file and start typing your fetch calls with it. When the API shape changes, paste a new sample and regenerate.
Why JSON to TypeScript
- Paste a JSON sample and get accurate types back. This json to typescript step reads each field, including nested objects, so the result matches your data.
- It handles arrays with mixed types using union types, so messy responses still produce valid output.
- You name the root and it builds a ready json to typescript interface, then quotes any keys that need it for valid TypeScript.
- Runs in your browser. Your data never leaves your device, which keeps private payloads private.
- Free with no limit. A quick json to ts pass with no sign up.