JSON Formatter
Beautify, minify and validate JSON with instant error reporting.
Input & output
All processing stays in your browser. Nothing is stored or transmitted.
No output yet. Paste JSON and run Format, Minify or Validate.
Before & after
Sizes are UTF-8 bytes; characters are Unicode grapheme clusters.
Validation uses the browser's own JSON engine: the error message is the engine's text, and a line/column is shown only when the engine reports a position — measured in UTF-16 code units, exactly as the engine counts them. Duplicate-key detection is a separate scan over already-valid JSON, so it cannot disagree with the parser.
About this tool
JSON Formatter formats, minifies and validates JSON locally in your browser — no upload, no tracking.
- Beautify JSON with 2 spaces, 4 spaces or tabs; minify to a single line.
- Validate using your browser's own JSON engine — the message shown is the engine's text, with line/column only when a position is provided.
- Real duplicate-key detection with line/column locations (last value wins; escaped and literal spellings of the same key count as different).
- Before/after character and UTF-8 byte counts with savings percentage.
- Copy, download and clear; inputs over 1 MB are not processed. Nothing is stored or transmitted.
Known semantics to be aware of: formatting re-parses the document with JavaScript semantics, so integer-like keys (e.g. "1", "2") may be reordered, and when duplicate keys exist the last value is kept — any duplicates found are reported above rather than silently dropped. Inputs whose values parse to Infinity, NaN or -0 are refused with an explanation instead of being silently rewritten to null or 0. Minifying usually saves bytes; it can occasionally make a document slightly larger when escaping values. Inputs above 1 MB are not processed.