JSON Formatter & Beautifier
LiveIn-browser onlyFormat with 2-space, 4-space, or tab indent, minify whitespace, sort object keys, and check byte size — 100% in-browser.
How to format JSON in 3 steps
Paste JSON to beautify it with 2-space, 4-space or tab indentation, minify it, or sort its keys recursively. Files up to 5 MB, formatted in your browser.
Paste or load JSON
Paste your JSON into the left pane, or press Sample to load an example.
Format & validate
It formats as you paste. Press Format, or Minify to strip every byte of whitespace instead.
Sort, copy & export
Set the indent width or Sort keys beside the result, then Copy or Download it.
Errors pinned, keys sorted, nothing uploaded
Exact error locations
Invalid syntax points to the exact line and column so you fix missing commas and brackets immediately.
100% private in-browser
Formatting happens in your browser, with parsing in a Web Worker. Your JSON is never uploaded or sent anywhere.
Recursive key sorting
Alphabetize object keys recursively all the way down for deterministic Git diffs while keeping arrays in order.
Live byte counters
Real-time size counters measure raw and minified text so you know exact bandwidth savings before transfer.
What a JSON formatter actually does (and why whitespace matters)
JSON has no opinion about whitespace. {"a":1} and the same object spread across four indented lines are the identical document to a parser — the difference exists only for the person reading it. A JSON formatter, or beautifier, parses the text into abstract values and writes it back out with consistent indentation and line breaks. That is why it doubles as a validator: if it will not format, it will not parse, and the error names the exact line and column.
That matters most with JSON you did not write: a minified API response, a payload squeezed onto one log line, or a config file hand-edited until its nesting is unreadable. Sorting keys is the other half — objects are unordered by definition, so two equivalent payloads can produce chaotic Git diffs. Array order is left untouched, because arrays are ordered and sorting them would alter your data.
The output is standard JSON as defined by RFC 8259 and ECMA-404: formatting changes only whitespace and, if you ask, key order — never a value.
{"user":"Ada","roles":["admin"]}{
"roles": ["admin"],
"user": "Ada"
}Formatter Engine Standards
What the formatter does, and what it leaves alone.
- ✓Standardized 2-space, 4-space, or tab indent
- ✓Recursive alphabetical key reordering
- ✓Lossless minification for network payloads
- ✓Files up to 5 MB, parsed in a Web Worker
- ✓Syntax error pinpointing (exact line & column)
Zero server uploads. Your JSON payloads are processed exclusively inside your browser sandbox.
Frequently asked questions
Formatting, minifying, key order and privacy, answered.
Is my JSON uploaded anywhere?
Why did my file fail to parse?
Does sorting keys change my data?
What is the difference between formatting and minifying?
Should I indent with 2 spaces, 4 spaces or tabs?
Can it handle comments or trailing commas?
How do I pretty print JSON in code?
Related tools
More browser-based JSON utilities
Formatted it? Now see its shape.
Open the same JSON as a graph: every object becomes a node, an array of records collapses into one schema card, and clicking a node gives you its JSONPath.
Last updated