JSON to TypeScript interface generator
Paste a JSON response and get TypeScript declarations back: nested objects become named interfaces, arrays infer their element type, and a field that is null or missing somewhere in the sample is marked optional rather than silently typed as any.
The sample is walked once to collect every key and every observed type at each path, so two array elements with different shapes produce a union instead of whichever happened to come first. Names are converted to PascalCase and sanitised to valid identifiers.
Runs entirely in this tab. Nothing you paste is uploaded, logged or stored — close the page and it is gone.
Questions about this tool
Are the generated types guaranteed correct?
No. They describe the sample you pasted, not the full API contract. A field that is absent from one response but present in another is only detected if both appear in the sample, so treat the output as a starting point you edit.
How are mixed array element types handled?
Every element type seen in the array is collected and emitted as a union. Two shapes with different keys also produce a merged object type when they are both objects.
What about keys that are not valid identifiers?
Interface names are converted to PascalCase and any invalid characters are dropped. Object keys that are not valid identifiers are emitted as quoted property names, which TypeScript accepts.
AI alternatives from the directory
Browse coding tools →This utility handles the job by hand. These do it with a model — worth a look when the task outgrows copy and paste.
The AI-first code editor
Built on VS Code, Cursor offers codebase-aware chat, multi-file edits and fast autocomplete for real engineering work.
Your AI pair programmer
Inline suggestions, chat and agentic edits inside your IDE, backed by OpenAI and trained on public code.
Generate UI from a prompt
Describe a component or page and v0 outputs React + Tailwind code you can iterate on and deploy instantly.