ts

JSON to TypeScript

Convert JSON to TypeScript interfaces automatically. Nested objects become interfaces, arrays become typed arrays, and nullable fields become unions.

Paste JSON and click Generate to produce TypeScript interfaces.

JSON input
Generated TypeScript

What this tool does

This JSON to TypeScript converter takes a JSON document and generates TypeScript type definitions from its shape. It runs entirely in your browser — your data never leaves the page.

How it works

1. Infer types. Every value is inspected: strings, numbers, booleans, null, arrays and nested objects.
2. Merge shapes. Array items are merged so optional fields stay optional.
3. Name fields. Keys become valid target-language identifiers.
4. Emit code. TypeScript definitions preserve original JSON keys.

Frequently asked questions

Does it generate interfaces or types?

It generates TypeScript interfaces. Nested objects become interfaces and arrays become typed arrays.

How are nullable fields handled?

Fields that can be null become unions with null, and optional array items stay optional.

Does JSON to TypeScript upload my data?

No. JSON to TypeScript runs entirely in your browser — your input never leaves this page.

Is JSON to TypeScript free to use?

Yes. JSON to TypeScript is completely free, with no account and nothing to sign up for.

Updated 2026-08-07 · Runs in your browser — your data never leaves this page.