TypeScript to JSON Schema

Generate JSON Schema from TypeScript interfaces for validation and API docs

TS TypeScript
{} JSON Schema

How It Works

1

Paste TypeScript

Enter TypeScript interfaces, types, or type definitions.

2

Click Generate

Our tool parses types and maps them to JSON Schema properties.

3

Get Schema

Copy the JSON Schema or download it for API documentation.

Type Mappings

TypeScript Type JSON Schema Type Description
string"string"Text values
number"number"Numeric values
boolean"boolean"True/false values
any{}Any type allowed
Array<T>"array" + itemsArray with typed items
interface"object" + propertiesObject with properties
enum"string" + enumString enum values
T | nulltype: [..., "null"]Nullable union type

Watch How It Works