JSON Formatter
Validate, pretty-print and minify JSON — entirely on your device.
How to use JSON Formatter
Validate, pretty-print and minify JSON. No upload, fully private.
Open JSON Formatter on toolpermarket — the form is ready, so type your numbers and read the result.
In the Input field, paste any JSON — an object, an array, or a bare value like a string or number. Invalid JSON is reported instead of crashing, so you can fix it in place.
In the Format / Minify field, choose pretty two-space indentation or a single collapsed line. Use Format for reading and Minify to shrink payloads before sending.
Press Format to compute the result. The output appears immediately below the form. Edit a value and press the button once more to see the updated answer.
Read the result and use it as needed. If the number looks off, re-check your inputs and run it again — the math is deterministic, so the same entries always return the same answer.
Worked example. Pasting {"a":1,"b":2} and clicking Format returns the same data spread over lines with two-space indent and quoted keys.
Tips for accurate results.
Pretty-print API responses to scan large objects quickly.
Minify before embedding JSON inside inline scripts or attributes.
Watch the status line — it names the exact character where parsing failed.
When to use JSON Formatter. Cleaning up compacted API responses for review. Spotting missing commas or quotes before a deploy. Shrinking config blobs to paste into a terminal.
When you actually reach for this
- An API returned a one-line JSON blob and you need to read the structure or find a nested field.
- You want to pretty-print config before committing it so reviewers can actually read the diff.
Where this tool stops being accurate
- JSON has no comments and no trailing commas, so if your source had them it is not valid JSON and must be cleaned first.
- Numbers keep full precision only as text; some pretty-printers may re-round very large integers if they parse through a float.
Frequently asked questions
Why does it say my JSON is invalid?
The most common causes are trailing commas, single quotes instead of double quotes, and unquoted object keys. JSON is stricter than JavaScript: keys and string values must use double quotes and no trailing comma is allowed after the last item. The status line points at the character where parsing stopped so you can fix it directly.
Will formatting change my data?
No. Formatting and minifying only change whitespace and indentation, never the values, key order or structure. The output is the same JSON your parser will read, just laid out differently for humans or compressed for transport.
Is there a size limit?
For typical payloads the tool is instant and fully local. Very large inputs can be slower on low-powered devices simply because more text must be parsed, but the process stays private and never leaves your browser.
Why does formatting fail with "Unexpected token"?
The input is not strict JSON — usually a trailing comma, a comment, single quotes, or unquoted keys. Strip those or use a JSON5-tolerant parser first.
My big integer changed after formatting — what happened?
Some tools parse JSON through JavaScript numbers, which lose precision above 2^53. Use a parser that keeps values as strings if you handle IDs or timestamps that large.