Types, straight from your JSON.
Paste raw JSON and get clean, production-ready TypeScript interfaces on the fly — nested objects, smart unions, optional fields, and zero setup.
- 100% client-side — nothing uploaded
- Free, no sign-up
- Interface & type aliases
// Types appear here — paste JSON on the left.
Why set your types with JSONts
An engineering-grade type generator that respects your data and your time.
Deep Composition
Every nested object becomes its own named interface — and identical structures are de-duplicated, so your type file stays tight.
Smart Inference
Mixed arrays merge into one type: missing keys become optional ?, differing values become precise unions like null | string.
Private by Design
The whole press runs in your browser. API responses, config files and private payloads are never uploaded, logged or stored.
paste once, type everywhere
If you work with API responses, configuration files, or test fixtures, you already know the friction of hand-writing TypeScript interfaces. This converter bridges that gap by reading any valid JSON object and producing ready-to-use type definitions. It is built for developers who want to skip boilerplate without sacrificing precision. Whether you are prototyping a frontend, documenting an undocumented endpoint, or migrating a JavaScript codebase, the output drops directly into your .ts files. Toggle between interfaces and type aliases, mark optional keys, and export a standalone .d.ts file in seconds.
from clipboard to compiled types
- Paste your raw JSON into the input editor or click Sample to load a demonstration object.
- Enter a name in the Root field to set the top-level type identifier.
- Toggle Optional ?, Null unions, or Readonly to match your project's strictness requirements.
- Switch between the interface and type buttons depending on your preferred declaration style.
- Click Copy Types for your clipboard or Download .d.ts to save the generated file directly.
Frequently Asked Questions
How do I convert JSON to TypeScript interfaces?
Paste your JSON into the left pane of the JSONts converter. The tool parses it instantly and prints ready-to-use TypeScript interfaces in the right pane. Click Copy Types or Download .d.ts to take the result into your project.
Is this JSON to TypeScript converter free?
Yes. JSONts is completely free with no sign-up, no limits and no watermarks. It runs entirely in your browser, so there is nothing to install and no account required.
Does my JSON data get uploaded anywhere?
No. The conversion runs 100% client-side in your browser with JavaScript. Your JSON never leaves your machine, which makes JSONts safe for API responses, config files and private payloads.
How are nested objects handled?
Every nested object becomes its own named interface, derived from the property name. For example, a nested "profile" object becomes an interface called Profile, and the parent field references it as profile: Profile.
What happens when an array contains objects with different keys?
JSONts merges all object shapes in the array into one interface. Keys missing from some elements become optional fields with the ? modifier, and keys with different value types become union types.
Can I generate type aliases instead of interfaces?
Yes. Use the interface / type switch in the toolbar above the editor. Interface mode emits interface Name { ... } blocks, while type mode emits type Name = { ... } aliases.
How are null values converted?
By default, null is merged into unions, so a field that is sometimes a string and sometimes null becomes null | string. You can disable the Null Unions option to treat null strictly as the literal null type.