JSON to TypeScript
Convert a JSON to TypeScript interfaces with automatically inferred types. Detects strings, numbers, booleans, arrays, nested objects and union types. Everything in your browser.
JSON inválido — verifique sintaxe.
Como funciona?
O conversor lê seu JSON e infere o tipo TypeScript correspondente para cada campo: string, number, boolean, null, arrays e objetos aninhados (cada um vira uma interface separada). Quando um array tem itens de tipos diferentes, é gerada uma união ((string | number)[]).
Útil para gerar tipos a partir de respostas de APIs reais, payloads de webhooks ou estruturas de dados que você acabou de receber. Tudo roda no seu navegador — nada é enviado a servidores.
Related Tools
PDF to Images
Convert PDF pages to individual PNG images. Everything in your browser via pdf.js.
Pixel Art Converter
Convert an image to pixel art by reducing resolution and color palette. Stylized retro output.
Currency Converter
Convert between major currencies (USD, EUR, BRL, GBP, JPY, ARS) using live rates from open.er-api.com.
Generate TypeScript interfaces from JSON
Typing an API response in TypeScript pays off. Writing those interfaces by hand from a big JSON, though, is tedious and easy to botch. Paste your JSON here and the matching interfaces come out automatically, with the types already inferred.
It recognises strings, numbers, booleans, arrays and nested objects, and when values vary it builds type unions too, so the result mirrors the shape of your data. Within seconds you've got code ready to drop into the project, which saves the manual grind and cuts down on typos.
Your JSON never leaves your device, because the whole conversion happens in the browser. Paste the data, copy the interfaces, and your code ends up with strong typing.