Resposta: O Formatador e validador de JSON gera seu resultado instantaneamente a partir da entrada que você informar — tudo roda no seu navegador, grátis, sem necessidade de cadastro.
Formate, valide, minifique e embeleze JSON na hora
O resultado formatado aparecerá aqui...
JSON (JavaScript Object Notation) is a lightweight data interchange format that's easy for humans to read and write, and easy for machines to parse and generate. It's the standard format for APIs, configuration files, and data storage. JSON supports exactly six data types — strings, numbers, booleans, null, objects, and arrays — and its grammar is strict enough that a single misplaced comma or quote makes the whole document unparsable. That strictness is why a formatter with instant validation matters: it tells you not only that something is wrong but where the parser gave up.
Tudo que este formatador faz acontece no seu navegador. Seu JSON nunca é enviado, então é seguro para respostas de API com dados privados, credenciais em arquivos de configuração ou cargas ainda em desenvolvimento.
Formatting (also called beautifying or pretty-printing) re-inserts indentation and line breaks so the structure of nested objects and arrays is visually obvious. Minifying does the opposite — it strips every byte that isn't required by the grammar, producing the smallest valid document for transmission. Validating parses the document and reports success or the exact position of the first syntax error without changing anything. All three operate on the same text, so you can round-trip freely: minify an API response to see its size, format it to read its structure, validate after every edit.
{"a": 1,}— remova a última vírgula{'a': 1}— o JSON exige aspas duplas{a: 1}— as chaves devem estar entre aspas duplasMuitos documentos que parecem JSON são na verdade literais de objeto JavaScript, e a diferença é exatamente de onde vêm a maioria dos erros de validação. A tabela abaixo lista as construções que o JavaScript tolera mas o JSON estrito proíbe.
| Construção | JavaScript | JSON estrito | Fix |
|---|---|---|---|
| Strings com aspas simples | Permitido | Inválido | Use aspas duplas |
| Chaves sem aspas | Permitido | Inválido | Coloque aspas em toda chave |
| Vírgulas finais | Permitido | Inválido | Apague a vírgula final |
| Comentários | Permitido | Inválido | Remova ou mova para um formato-wrapper |
| Valores undefined | Permitido | Não é um tipo do JSON | Use null ou omita a chave |
| NaN / Infinity | Permitido | Números inválidos | Use null ou uma string |
Minified JSON is what APIs actually ship — indentation costs bytes on every request. But the savings only come from whitespace: minification does not rename keys, shorten strings, or restructure data. A large minified document and its formatted twin contain identical information, so gzip compression largely erases the difference on the wire; formatting matters most for local files, logs, and developer tooling rather than production transfer. A useful workflow is to keep source files formatted for readability and generate the minified version as a build step, exactly as you would with JavaScript or CSS.
JSON's dominance means most adjacent formats are JSON with extensions. JSON5 relaxes the grammar for humans, permitting comments, trailing commas, and unquoted keys. JSON Lines (JSONL) stores one JSON value per line, popular for logs and streaming datasets. JSON with Padding (JSONP) is a legacy cross-domain technique that predates CORS and is now obsolete for new work. GeoJSON adds coordinate structures for geographic data, and JSON Schema describes the shape a document must have, enabling validation beyond mere syntax. A strict formatter like this one is the common denominator across all of them: syntax-level correctness is the first gate any of these formats must pass.
The practical pain of reading JSON scales with nesting depth. At two or three levels, indentation alone is enough. Beyond that, a few habits help: scan for the key you need at each level rather than reading linearly; note array boundaries early, since a misplaced bracket is the most common reason an expected key "disappears" (it lives in a sibling element of an array you skipped); and when hunting one value inside a huge document, format it, copy the path down as you descend, and paste the fragment into a scratch file. Errors reported at the end of a document usually mean an unterminated construct somewhere above — a missing closing brace or quote — which is exactly the case where a formatter's error position beats eyeballing.
Meu JSON é enviado para um servidor?
Não. Formatação, minificação e validação rodam localmente no seu navegador com JavaScript. Nada do que você colar é transmitido ou armazenado, então a ferramenta é segura para dados confidenciais.
Qual a diferença entre formatação e validação de JSON?
A formatação reescreve o documento com indentação consistente preservando seu conteúdo e estrutura. A validação apenas analisa o documento e informa se ele está sintaticamente correto, sem alterar nada. Esta ferramenta valida continuamente enquanto você digita e formata sob demanda.
Por que o JSON não permite comentários?
A especificação do JSON define uma gramática mínima de dados apenas; comentários foram deliberadamente excluídos para manter os interpretadores simples e o formato sem ambiguidade. Soluções comuns são uma chave "_comment" dedicada, JSON5 para humanos, ou YAML, onde comentários são cidadãos de primeira classe.
Esta ferramenta pode corrigir JSON quebrado automaticamente?
Ela valida e informa a posição exata do erro, mas não vai adivinhar a intenção. Reparar significa decidir o que o autor quis dizer — remover uma vírgula final é seguro, mas escolher entre duas aspas possíveis numa string não fechada não é uma decisão que uma ferramenta deveria tomar em silêncio.
A formatação altera meus dados?
Não. A formatação só ajusta o espaço em branco entre tokens. A ordem das chaves, os valores e a estrutura são preservados exatamente; a saída re-analisada gera dados idênticos à entrada.