TypeScript to JSON Schema
Runs in browserConvert TypeScript interfaces and types to JSON Schema instantly.
Convert TypeScript interfaces and types to JSON Schema instantly. Fully client-side, no uploads.
TypeScript to JSON Schema tool
🔒 Runs in your browser · No uploads · Your data never leaves your device
How to use
Paste TypeScript
Paste an interface or type alias into the left panel.
Get JSON Schema
JSON Schema draft-07 appears instantly in the right panel.
Copy
Click Copy JSON Schema to copy the output.
Common use cases
- Generating runtime validators from TypeScript types — Convert TypeScript interfaces to JSON Schema to use with ajv or similar validators for runtime data validation.
- Documenting TypeScript APIs — Generate JSON Schema from TypeScript types to include in API documentation alongside endpoint descriptions.
Examples
Interface to schema
User interface with optional email field.
Inputinterface User { id: number; name: string; email?: string; }Output{"$schema":"http://json-schema.org/draft-07/schema#","title":"User","type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name"],"additionalProperties":false}
Frequently asked questions
- Does it use a library?
- No. The parser is hand-written and runs entirely in your browser — no dependencies.
- Which TypeScript features are supported?
- interface, type alias, optional fields (?), arrays, union types including null, inline objects, and Date.
Key concepts
- TypeScript interface
- A compile-time structure defining object shape in TypeScript — no runtime representation exists unless converted.
- JSON Schema
- A runtime-usable format for describing and validating data structures, compatible with many validators and code generators.
Related tools
You might find these useful too.
- JSON Schema Generator
Generate JSON Schema from any JSON object instantly.
Open - JSON to TypeScript Types
Generate TypeScript interfaces and types from JSON instantly.
Open - JSON Validator
Validate JSON syntax and see exact error messages instantly.
Open - JSON Schema to TypeScript
Convert JSON Schema to TypeScript types and interfaces instantly.
Open