JSON to TypeScript
Format and minify JSON, or convert it to YAML, CSV, XML, TypeScript, Zod, JSON Schema, GraphQL, SQL and more.
Paste your input on the left and press Translate (or Ctrl/Cmd + Enter) to get the result on the right. Free, no sign-up.
Example
{
"id": 42,
"name": "Ada Lovelace",
"email": "ada@example.com",
"active": true,
"score": 98.5,
"tags": ["math", "computing"],
"address": {
"city": "London",
"zip": "W1"
}
}export interface Root {
id: number
name: string
email: string
active: boolean
score: number
tags: string[]
address: Address
}
export interface Address {
city: string
zip: string
}
Frequently asked questions
- How do I generate types from JSON?
- Paste a sample object and choose TypeScript, Zod Schema or JSON Schema. The tool infers a type from the values it sees, so use a representative sample.
- Why does my JSON fail to convert?
- Most failures come from trailing commas, single quotes or unquoted keys. JSON requires double quotes and no trailing commas.
- Is my JSON uploaded?
- No. JSON conversions run in your browser.