JSON Formatter
Paste JSON, validate it, format or minify it
Input
Output
Formatted or minified JSON will appear here.
What this tool does
JSON Formatter checks whether a block of JSON is valid, then rewrites it either as neatly indented, readable text or as a compact single-line string. Everything happens locally in your browser — nothing you paste is sent anywhere.
How it works
- Paste JSON — put your JSON text into the Input pane.
- Format — validates the JSON and rewrites it with consistent indentation and line breaks in the Output pane. If something's wrong, the exact error and its position are shown instead.
- Minify — validates the JSON and collapses it to the smallest possible single-line form, useful for pasting into configs or APIs.
- Indent — choose 2 spaces, 4 spaces, or a tab for formatted output.
- Sort keys — when checked, object keys are alphabetized in the output, which can make diffs easier to read.
- Copy Output / Download .json — grab the result once it's valid.
Good to know
- Validation follows strict JSON rules — trailing commas, single quotes, and unquoted keys (all valid in JavaScript object literals) are flagged as errors here, since they aren't valid JSON.
- Sorting keys changes key order but never changes values, arrays stay in their original order.
- Very large JSON documents may take a moment to format — the tool processes everything in memory in your browser.