Skip to content
Json Works

Runs in your browser · nothing is uploaded

JSON to TypeScript Converter

Generate TypeScript interfaces, JSON Schema or Zod from a JSON sample. Optional and nullable fields are detected across array items. Runs in your browser.

JSON sample

Empty

Output

—

Types from real data, not guesses

Hand-writing types for a 40-field API response is tedious and error-prone. Paste the response and get accurate, merged types — including the optional fields you would have missed — ready to drop into your codebase.

How to use JSON to TypeScript

  1. Paste a JSON sample — a real API response gives the best types.
  2. Pick the output: interfaces, types, JSON Schema or Zod, and set the root name.
  3. Copy the result into your project or download it as a .ts / .json file.

Private by design

JSON to TypeScript runs entirely in your browser. Your data is parsed and converted on your device with JavaScript — it is never sent to a server, logged or used for analytics. Recent inputs are kept in your browser’s own storage so you can come back to them, and they disappear when you clear cookies and site data (or press Clear history). You can verify this in your browser’s network tab.

Frequently asked questions

How does it know which fields are optional?

When your JSON has an array of objects, all items are merged. A field missing from some items becomes optional (?), and a field that is sometimes null becomes T | null. Fields with different types across items become a union.

Can I get a JSON Schema or Zod schema instead?

Yes. Switch the output between TypeScript interfaces, type aliases, JSON Schema (draft-07) and a Zod schema with inferred type.

How are nested objects named?

Each nested object becomes its own named type from its property name — customer becomes Customer, and items[] becomes Item. Name clashes get a numeric suffix.

Is my JSON sent anywhere?

No. Types are generated entirely in your browser.

Found a bug or have an idea for this tool? Send feedback.

More JSON tools

History

Saved only in this browser (IndexedDB). It never leaves your device and disappears when you clear cookies and site data.