Tested tool guide
Tested browser tools
Checked August 16, 2026
What TypeScript to JSON Schema does, with a checked example
TypeScript interfaces and type aliases become JSON Schema documents here: each property is mapped to its schema type, arrays get an items keyword, unions of literals become an enum, and the required array is rebuilt from your ? optional markers. Two things usually surprise people. First, TypeScript has no required keyword - a converter's only signal for what belongs in required is the question mark, so a property written without one is assumed required even when real data often lacks it. Second, this tool converts any and unknown to an empty schema {} that accepts anything, and Date conventionally maps to a string with a date-time format. The conversion runs entirely in the browser; nothing you paste is uploaded.
Worked example
A concrete input and expected output from the current implementation.
Input
type User = {
id: number;
name?: string;
tags: string[];
role: 'admin' | 'member';
}; ->
Expected output
{
"type": "object",
"properties": {
"id": { "type": "number" },
"name": { "type": "string" },
"tags": { "type": "array", "items": { "type": "string" } },
"role": { "enum": ["admin", "member"] }
},
"required": ["id", "tags", "role"]
} name carries the ? marker, so it appears in properties but not in the required array, while the other three properties are listed there. tags becomes an array with an items schema, and the two-element string literal union collapses into an enum listing exactly 'admin' and 'member'.