How to Convert JSON to TypeScript Types, JSON Schema or Python
Turn a sample JSON response into TypeScript interfaces, a JSON Schema or a Python dataclass in your browser. Learn what to review afterwards.
Start from a sample
Copy a real JSON response from your API or a file. A single representative example is enough to get a working first draft of a type or schema.
Generate the output
Open the JSON to Schema tool and paste the JSON, then pick TypeScript, JSON Schema or Python. TypeScript output creates a separate interface for each nested object. JSON Schema output is draft-07. Python output is a single dataclass. Copy the result with one click. The conversion runs in your browser, so your data is not uploaded.
What to review
The tool works from one sample. For an array it uses the first item, so fields that only appear in later items are missed. Every key is treated as required, and null values become any in TypeScript, so mark optional fields and tighten types by hand.
Key names and nesting
In the TypeScript output, keys with spaces or hyphens are written without quotes, so rename or quote them before using the types. In the Python output, nested objects are typed as plain dict instead of their own class.
Mehr aus dem Blog
Was ist Becoderr? Über 120 kostenlose Online-Tools an einem Ort
Becoderr ist eine kostenlose Sammlung von 145 Online-Tools für PDFs, Bilder, JSON, Text, Entwickler und Alltag — privat, schnell und ohne Anmeldung.
Bilder komprimieren ohne Qualitätsverlust
Reduziere die Bildgröße um bis zu 90 %, ohne dass Fotos unscharf werden. Kurze Anleitung zum Komprimieren von JPG und PNG online, kostenlos und privat.
PDF in ein bearbeitbares Word-Dokument umwandeln
Wandle jedes PDF in ein bearbeitbares .docx um, das du in Microsoft Word ändern kannst, kostenlos und ohne Anmeldung.