Skip to content

JSON Beautifier

Paste minified or messy JSON to instantly beautify it with clean indentation. Supports 2-space, 4-space, and tab indent styles, plus optional alphabetical key sorting.

Quick Actions:
JSON Input 0 lines
JSON Output
Valid JSON
| Input: 0 lines • 0 B | Output: 0 lines • 0 B
Depth: 0 Keys: 0

Como funciona

Fórmula

JSON.stringify(JSON.parse(input), null, indentLevel)

Exemplo prático

'{"b":2,"a":1}' beautified with 2-space indent and sorted keys becomes '{ "a": 1, "b": 2 }'

How JSON Beautification Works

The beautifier uses the two-step process built into every modern JavaScript engine:

  1. Parse: JSON.parse(input) converts the raw JSON text into a native JavaScript object, throwing a SyntaxError if any character violates RFC 8259.
  2. Serialize: JSON.stringify(parsed, null, indent) re-serializes the object with your chosen indent level.

This round-trip guarantees that the output is always syntactically valid JSON, regardless of how malformed the input spacing or ordering was.

When to Sort Keys

Key sorting is invaluable for git diff comparisons between two versions of the same configuration file, especially when different tools or editors produce the same data with keys in different orders. With sorted keys, only genuine value changes appear in diffs.

Perguntas frequentes

What is JSON beautification?

JSON beautification (also called pretty-printing) adds whitespace, newlines, and indentation to a compact JSON string, making nested structures human-readable without changing the data.

Does beautifying JSON change the data?

No. Beautification only changes whitespace. The parsed data structure is identical. If you enable key sorting, key order changes, but all values remain the same.

What indent style should I use?

2 spaces is the modern standard used by TypeScript, Node.js, and most linters. 4 spaces is traditional for Python and Java projects. Tabs are preferred in some Go and Go-adjacent codebases.

Is my JSON data safe?

Yes. All processing happens 100% in your browser using the native JSON.parse() and JSON.stringify() APIs. No data is sent to any server.

Última atualização: 19 de mar. de 2026
datas e tempo

Contador De Dias Calculator

pt-BR: dias entre duas datas (incluir ultimo dia), dias ate uma data futura (contagem regressiva), somar/subtrair dias.

datas e tempo

Calculadora De Horas Trabalhadas Calculator

pt-BR: rows of entrada, saida, intervalo -> horas do dia; week/month total; hora extra above jornada (default 8h/44h); output hh:mm and decimal.

datas e tempo

Calculadora Entre Datas Calculator

pt-BR: diferenca entre duas datas in anos/meses/dias, total dias/semanas/meses; adicionar/subtrair periodo.

financas

Calculadora De Investimentos Calculator

pt-BR: aporte inicial, aporte mensal, taxa (a.a. or a.m. toggle), prazo -> montante = FV with contributions; optional IR regressivo (22.5% up to 180d, 20% 181-360d, 17.5% 361-720d, 15% >720d); CDI/Selic/poupanca reference rates come from data/rates.json and are editable, never hard-coded.

saude

Calculadora De Pace Calculator

Same logic as pace calculator, native pt-BR UI/copy: ritmo por km/milha, provas (5K,10K,21K,42K).