JSON Formatter
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
Beautify, minify and validate your payloads in seconds, with full control over spacing and key order.
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.
Engineered for precision & privacy
Exact error locations
Invalid syntax points to the exact line and column so you fix missing commas and brackets immediately.
100% private in-browser
Parsing runs strictly in your browser Web Workers. 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.
{"user":"Ada","roles":["admin"]}{
"roles": ["admin"],
"user": "Ada"
}Formatter Engine Standards
Strict adherence to official internet data interchange specifications.
- ✓Standardized 2-space, 4-space, or tab indent
- ✓Recursive alphabetical key reordering
- ✓Lossless minification for network payloads
- ✓Off-thread Web Worker execution (0ms main thread)
- ✓Syntax error pinpointing (exact line & column)
Zero server uploads. Your JSON payloads are processed exclusively inside your browser sandbox.
Frequently asked questions
Everything you need to know about browser-based formatting, validation, and privacy.
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?
Related tools
More browser-based JSON utilities
Stop reading raw brackets. Start seeing connections.
Paste the same JSON into the graph and see it as connected nodes you can search, fold and export — completely free and in-browser.