🔒 Runs in your browser · nothing uploaded

JSON to TypeScript Converter

Paste any JSON, get clean TypeScript interfaces or types — with nested objects, optional fields, array union inference, and sensible naming. No signup. Runs entirely in your browser.

✔ 100% Free ✔ No signup ✔ No data sent ✔ Nested objects supported
Input JSON
TypeScript Output
// Output will appear here as you type
Ready — paste JSON and click Convert (or just start typing). 0 chars
Try an example:

What this tool does

Generates TypeScript interfaces (or type aliases) from any valid JSON input. It walks the entire JSON tree, infers the type of every field, and produces a set of named interfaces that you can paste straight into your codebase. Designed for the common case: you've got an API response, an example payload, or a config file, and you want types that match.

What it handles well

Toolbar options

What it doesn't do (yet)

When you'd actually use this

The typical workflow: you get an API response from a third-party (Stripe, GitHub, your own backend), you want to type it in your client code, and you don't want to hand-write 40 nested interfaces. Paste the JSON, get the types, paste them into a .ts file, rename the root, and ship.

It's also useful for working with config files, webhook payloads, scraped data, and Mongo documents — anywhere you need quick type safety from sample data. For long-term schema management, consider deriving types from a single source of truth (Zod schema, OpenAPI spec, GraphQL types) instead.

A few caveats

The generated types match what your sample JSON contains, not what the API actually returns. If a field is sometimes a number and sometimes a string across responses, you need to paste both samples for the converter to produce the union. If a field is sometimes missing entirely, enable "All optional" or paste a sample where it's absent.

For mission-critical typing — payment APIs, auth flows, anything where a wrong type costs money — consider deriving types from the official OpenAPI spec or from a validation library like Zod. This tool is for the 80% case where you need types right now and don't have a spec to lean on.

Looking for an AI engineer or TypeScript role?

Browse 100+ AI / ML and engineering jobs profiled with real culture data — Glassdoor scores, work-life-balance ratings, and what employees actually say about working there.

Browse Engineering Jobs → Portfolio project ideas →

Frequently asked

Is this JSON to TypeScript converter free?+
Yes — 100% free, no signup, no email required. Everything runs entirely in your browser. We built it as a free tool for the developer community.
Is my JSON data safe?+
Yes. The converter runs entirely in your browser using JavaScript. Your JSON is never sent to any server, never logged, and never stored. Safe for sensitive payloads, API responses, and proprietary schemas.
Does it support nested objects and arrays?+
Yes. The converter walks the entire JSON tree and generates a separate interface for every nested object. Arrays of objects are merged into a single shape so the output is clean and reusable. Arrays of mixed primitives become union types like (string | number)[].
What's the difference between interface and type in the output?+
Both describe object shapes. interface is the more common choice for object types because it supports declaration merging and is the convention in most React/Node codebases. type is required for unions, intersections, and conditional types. For pure JSON-derived schemas, interface is usually what you want.
Can I make all fields optional?+
Yes — use the "All optional" toggle. By default, every field present in your JSON is marked as required. If your JSON is a single sample from an API where fields may be missing on other responses, enable the optional toggle to add ? to every key.
How does it handle null values?+
Null values become null in the type. If a field could be null OR a value (based on the array samples), it becomes a union like string | null. If you want to treat null as "field unknown," enable "Null = optional" to convert null fields to optional any.
Why are there no comments in JSON?+
The official JSON spec (RFC 8259) doesn't allow comments. If you need to convert JSON5 or JSONC (JSON with comments), strip the comments first or use our JSON Formatter to clean the input. The TypeScript output itself doesn't include JSDoc by default — add it manually after generating.