My Tools Garage

JSON Schema to TypeScript

Turn a JSON Schema into TypeScript interfaces.

in-browser

How to use

  1. 1 Paste your JSON Schema into the input panel.
  2. 2 Set the root type name and toggle exports as needed.
  3. 3 Read the generated TypeScript interfaces on the right.
  4. 4 Copy the output into your project.

About JSON Schema to TypeScript

JSON Schema to TypeScript generates ready-to-paste TypeScript interfaces from a JSON Schema document.

Paste your schema on the left and the matching type declarations appear on the right as you type, so you can keep your API contracts and your code in sync without writing the types by hand.

It is ideal for typing request and response bodies, config files, and any data described by a schema.

The converter understands the parts of JSON Schema you use most: object properties with a required list become required versus optional fields, string, number, integer, boolean and null map to their TypeScript equivalents, arrays become typed arrays, and enum values are emitted as string-literal unions.

Nested objects are extracted into their own named interfaces, named after the parent and property, so the output stays readable rather than collapsing into one giant inline type.

Property keys that are not valid identifiers are safely quoted, and you can rename the root type or turn the export keyword on and off to suit your module style.

Everything runs locally in your browser.

Your schema is never uploaded or stored, which matters when it describes a private or unreleased API, and the tool keeps working offline once the page has loaded.

FAQ

Which JSON Schema features are supported?

Objects with properties and required, arrays with items, primitive types, enums as string-literal unions, and nested objects. Advanced keywords like allOf, $ref and patternProperties are not yet resolved.

How are optional fields decided?

A property is required if it appears in the schema's "required" array; otherwise it is emitted with a "?" optional marker.