JSON to TypeScript
Paste a JSON example, such as an API response, and get TypeScript interfaces ready to use.
Runs in your browser · No uploads
Generate TypeScript
Your browser is too old to run this tool. Please update it, or use a current version of Chrome, Edge, Firefox or Safari.
- Nothing leaves your device
- No server-imposed size limits
- No sign-up, no watermark
- Free
How to convert JSON to TypeScript
- Paste your JSON, or try the example.
- Choose interface or type, export and optional fields.
- Copy or download the TypeScript.
What you get
- An interface for every object, named after its key.
- Optional fields (name?: string) for fields missing from some array items.
- Union types (string | null) where values differ.
- Keys that aren't valid names (like "created-at") are quoted.
Frequently asked questions
Is my JSON uploaded?
No. Everything happens in your browser, and the page is blocked from uploading anything.
Related tools
-
Make TypeScript, Go or a schema from JSON
Generate TypeScript interfaces, Go structs or a JSON Schema from example JSON. -
Format JSON
Beautify or minify JSON. -
JSON Schema from JSON
A JSON Schema (draft 2020-12) worked out from example JSON. -
JSON to Go struct
Go structs with json tags generated from example JSON.