Report

Help us improve this tool

TypeScript To JSON Schema

Generate JSON Schema from TypeScript interfaces and type aliases instantly in your browser with real-time output.

O M T

Convert TypeScript Types to JSON Schema

JSON Schema describes the shape of JSON data for validation, API documentation, and code generation. When your source of truth is TypeScript interfaces or type aliases, manually writing matching schemas is repetitive and error-prone. This tool generates JSON Schema directly from exported TypeScript types in your browser.

How it works

Paste TypeScript source containing exported interfaces or type aliases. Choose a single target type or generate schemas for all exported types at once. The output follows JSON Schema draft-07 conventions and updates in real time as you edit the input.

Related developer tools

For the reverse direction, use the JSON Schema to TypeScript converter. To generate Zod validators instead, try TypeScript to Zod or JSON Schema to Zod.

Frequently Asked Questions

Which TypeScript constructs are supported?

The generator handles exported interfaces, type aliases, unions, arrays, optional properties, and nested object types. Complex mapped types or conditional types may produce partial schemas.

Can I generate schemas for multiple types at once?

Yes. Enable the "Generate schema for all exported types" option to produce a combined definitions object containing every exported interface and type alias in your source.

Does this validate my TypeScript code?

The converter focuses on schema generation. Type-check errors in your source may still produce output, but fixing syntax issues gives more reliable results.

Is my code sent to a server?

No. TypeScript parsing and schema generation run entirely in your browser. Your source code never leaves your device.