Diese Seite ist noch nicht auf Deutsch verfügbar, daher zeigen wir die englische Version.

JSON Schema to TypeScript Converter

Paste a JSON Schema (draft-07 or 2020-12) and get TypeScript interfaces — required and optional properties, enums as union types, oneOf/anyOf as unions, allOf as intersections, $ref definitions as named types and descriptions as JSDoc comments.

Aktualisiert am
Declare as

Deine Daten verlassen nie deinen Computer. Die Verarbeitung erfolgt zu 100 % lokal im Browser.

So nutzt du: JSON Schema to TypeScript

  1. Paste your JSON Schema — or an OpenAPI components.schemas object — on the left.
  2. Set the root type name and whether to use interface or type.
  3. The TypeScript types update as you type; definitions under $defs or definitions become their own named types.
  4. Copy the code into a .ts or .d.ts file.

How JSON Schema maps to TypeScript

JSON SchemaTypeScript
"type": "string" / number, integer / boolean / nullstring / number / boolean / null
properties + requiredinterface with prop and optional prop?
enum, constliteral union: "draft" | "published"
items, prefixItemsT[], tuples [A, B]
additionalProperties (schema)index signature [key: string]: T
oneOf / anyOf / allOfA | B / A | B / A & B
$ref: "#/$defs/User"the named type User
"type": ["string", "null"]string | null

Validation-only keywords such as minLength, pattern or format have no TypeScript equivalent; they are added to the JSDoc comment when JSDoc is on. External $ref URLs are typed as unknown.

Starting from example data instead of a schema? Use JSON to TypeScript. To check data against a schema, use the JSON Schema Validator.

Auch gesucht als: json schema to ts, generate typescript from json schema, json schema interface, json-schema-to-typescript online, openapi schema to typescript, json schema types, json schema converter.

Passende Tools zu: JSON Schema to TypeScript

  • JSON to JSON Schema — Paste one or more JSON examples and get a JSON Schema that describes them: nested objects, arrays of objects merged into one item schema, required fields (keys present in every example), detected formats like email, date-time, URI and UUID, optional enums, and draft 2020-12 or draft-07 output.
  • JSON zu Typen — Füge eine API-Antwort ein und erhalte gebrauchsfertige Modelle in 8 Sprachen: TypeScript, Python (dataclass, TypedDict oder Pydantic), Go, Java, C#, Kotlin, Swift und Rust.
  • JSON Formatierer — Füge JSON ein, um es zu formatieren, zu minifizieren oder zu prüfen.
  • OpenAPI / Swagger Validator — Paste an API specification to check it against the official OpenAPI schema, catch broken references and inconsistent path parameters, and see every endpoint at a glance.

Häufige Fragen

How do I convert JSON Schema to TypeScript?
Paste the schema on the left; TypeScript interfaces appear on the right. Definitions in $defs or definitions become named types that $ref points to.
Which JSON Schema versions are supported?
Draft-04 to draft-07 and 2019-09/2020-12 keywords: properties, required, enum, const, items, prefixItems, additionalProperties, oneOf, anyOf, allOf, $ref, $defs and definitions.
Can I use it for OpenAPI schemas?
Yes — paste a single schema, or the whole components.schemas object to get one type per schema. #/components/schemas/ references are resolved.
Is my schema uploaded?
No. Conversion runs entirely in your browser.
Kann ich JSON Schema to TypeScript als Web-App installieren und offline nutzen?
Ja. JSON Schema to TypeScript ist eine installierbare Web-App (PWA) – sie wird über Ihren Browser installiert und nicht aus einem App-Store heruntergeladen. Klicken Sie oben auf dieser Seite in Chrome oder Edge (Windows, macOS, Linux, ChromeOS) auf „App installieren“ oder verwenden Sie auf Android-Geräten „Teilen“ → „Zum Startbildschirm hinzufügen“ auf dem iPhone und iPad bzw. „Datei“ → „Zum Dock hinzufügen“ in Safari 17+ auf einem Mac. Die App öffnet sich dann in einem eigenen Fenster mit einem eigenen Symbol, und da sie vollständig in Ihrem Browser ausgeführt wird, funktioniert sie auch offline. Firefox auf dem Desktop kann keine Web-Apps installieren. So funktioniert die Installation.

Ähnliche Tools