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.
Plus du blog
Qu'est-ce que Becoderr ? Plus de 120 outils en ligne gratuits au même endroit
Becoderr est une collection gratuite de plus de 145 outils en ligne pour PDF, images, JSON, texte, développeurs et tâches du quotidien : privé, rapide et sans inscription.
Comment compresser des images sans perdre en qualité
Réduisez la taille de vos images jusqu'à 90 % tout en gardant des photos nettes. Guide rapide pour compresser JPG et PNG en ligne, gratuitement et en privé.
Comment convertir un PDF en document Word modifiable
Transformez n'importe quel PDF en .docx modifiable dans Microsoft Word, gratuitement et sans inscription.