1001Ferramentas
🅃 Converters

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.

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

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.