Gerador de Interfaces TypeScript

Converta qualquer JSON em interfaces ou types TypeScript limpos.

Entrada JSON

Detalhes do nó

Selecione um nó para ver detalhes

Recursos principais

Smart Shape Merging

Elements of heterogeneous arrays merge into one interface; fields missing from some elements become optional with ?

Union Types

Fields holding mixed string/number/null values collapse into precise union types like string | null.

interface or type

Switch between interface and type alias output with one checkbox — root name is fully customizable.

Editable Source

Tweak the JSON in the Tree or Table view and the generated TypeScript updates instantly.

Como usar Gerador de Interfaces TypeScript

1

Paste Your JSON

Insert an API response or any JSON document into the input panel.

2

Review the Output

The TypeScript interface appears in the dedicated TS tab — adjust the root name or switch to a type alias.

3

Copy or Download

Copy the definitions to your clipboard or download them as a ready-to-use types.d.ts file.

Comparação de Arquitetura Técnica e Privacidade

Como o formatjson.net se compara às ferramentas JSON tradicionais baseadas em servidor

Execução 100% Local Zero Upload para Servidor Padrão RFC 8259 e RFC 4180 Inteiros de 64 Bits Seguros JSON Schema 2020-12 PWA Offline
Capacidade / Padrão formatjson.net (100% no Navegador) Ferramentas Tradicionais de Servidor
Processamento e Privacidade 100% local em JavaScript no navegador — seus dados nunca saem do dispositivo Frequentemente enviam JSON/XML/CSV para servidores remotos
Chaves de API, JWTs e Dados Sensíveis Seguro por design — zero transmissão de rede, funciona offline via Service Worker Risco de logs em servidores ou retenção por terceiros
Reparo de JSON Quebrado ou Truncado por IA Máquina de estados léxica corrige comentários, aspas simples, vírgulas finais e chaves abertas em 1 clique Falha com erro de sintaxe em JSON não estrito
IDs Snowflake de 64 Bits e Zeros à Esquerda Preserva inteiros acima de 2^53 - 1 e códigos como "00123" sem perda de precisão Trunca IDs de 64 bits ou remove zeros à esquerda
Exploração de Arrays Aninhados em Tabela Drill-down interativo ([n items] →) com breadcrumbs, ordenação de colunas e edição inline Tabelas planas apenas na raiz ou árvores somente leitura
Desempenho com Arquivos Grandes Árvore lazy em lotes (200 nós) + tabela paginada + proteção de highlight >150 KB Travamento da interface em arquivos de vários megabytes

Perguntas frequentes

How are optional properties detected? ▾

When an array contains objects where a key is missing in some elements, that key is emitted with a ? marker.

Does it handle nested objects? ▾

Yes. Nested objects are rendered as inline object type literals, and arrays of objects merge into a single element type.

interface vs type — which should I use? ▾

interface supports declaration merging; type aliases are more flexible for unions. The tool outputs either with one click.

Are null fields handled? ▾

A field observed as both string and null becomes a union type string | null, never silently dropped.

Is my JSON sent to a server? ▾

No. Type inference runs entirely in your browser — perfect for private API payloads.