JSON → TypeScript
Paste any JSON; **live-infer TypeScript types** — auto-named nested types (`users → User`), shape-merging across array elements, optional-field detection, mixed-type arrays as unions. Choose interface vs type, root name, and `readonly`. Runs entirely locally — no upload.
›How to use
- Paste any JSON on the left (API response, config file, fixture — anything).
- TypeScript
interface/typeis generated instantly with smart nested-type naming (e.g.User_Address). - Array with mixed-shape elements? Shapes are merged and
optionalis auto-marked. - Toggle
readonlyandtypevsinterfaceat the top, then copy into your SDK / model file.
Tips
- Want JSDoc comments? Add a
_docfield in your JSON — it gets attached to the generated type. - Null values in the API response become
T | null— never silently dropped.
Related tools
- JWT decoder / generatorDecode header / payload / expiry, re-sign with secret
- cURL ↔ fetch ↔ Python converterPaste a cURL command → emit fetch / Python requests / HTTPie
- CSS / XPath selector testerPaste HTML + selector → live highlight of matches
- Regex builder & live testerPattern + sample text → live highlight + capture groups