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.
Mais do blog
O que é a Becoderr? Mais de 120 ferramentas online gratuitas num só lugar
A Becoderr é uma coleção gratuita de mais de 145 ferramentas online para PDFs, imagens, JSON, texto, desenvolvedores e tarefas do dia a dia — privada, rápida e sem cadastro.
Como comprimir imagens sem perder qualidade
Reduza o tamanho das imagens em até 90% mantendo as fotos nítidas. Guia rápido para comprimir JPG e PNG online, grátis e privado.
Como converter um PDF em documento Word editável
Transforme qualquer PDF em um .docx editável que você altera no Microsoft Word, grátis e sem cadastro.