What you can do with this JSON formatter
Format & minify
Pretty-print JSON with 2-space, 4-space, or tab indentation. Strip all whitespace to compact one line.
Validate
Catch syntax errors with the exact line and column. Click to jump to the problem.
Tree view
Explore deeply nested JSON without scrolling forever. Collapse, expand, copy paths and values.
Repair broken JSON
Trailing commas, single quotes, comments, unquoted keys — Repair mode fixes them and tells you what changed.
Large files
Files over 200KB are parsed off-thread in a Web Worker so the UI never freezes.
Share via URL
Encode small payloads in the URL hash. Nothing is sent to a server — the hash stays in your browser.
How to format JSON online
- Paste, drop, or upload your JSON into the left pane of this online JSON formatter.
- Click Format (or press Ctrl+Enter) to pretty-print, or Minify (Ctrl+M) to compact it.
- Switch the right pane to Tree view — a built-in JSON viewer for exploring nested structures.
- If the input is broken, click Repair — JSONYard will fix what it can and explain the changes.
- Copy, download, or share the result.
Why pretty-print JSON?
JSON sent over the wire is usually minified — every byte counts. The moment a human has to read it, that compactness becomes the problem: nested objects collapse onto one line, errors hide between unbalanced brackets, and diff tools become useless. A JSON beautifier (also called a pretty-printer) reverses minification — it inserts newlines and consistent indentation so the document's shape matches its meaning. JSONYard's formatter gives you 2-space, 4-space, or tab indentation, optionally sorts keys, and validates while it formats so syntax errors surface at the exact line and column. If you need to compare two payloads after formatting, our structural JSON diff ignores whitespace and key order so a reformat doesn't show up as a "change".
JSON formatter, beautifier, validator, viewer — what's the difference?
All four labels describe overlapping things, which is why most online JSON tools ship them together. A JSON formatter or JSON beautifier adds indentation. A JSON validator checks that the input is well-formed JSON per RFC 8259 — JSONYard's JSON validator reports the exact line and column of any error. A JSON viewer renders the document as a collapsible tree so you can drill into deeply nested structures. JSONYard combines all four on this page; the dedicated tool pages add specialised capabilities like validating JSON against a JSON Schema or testing JSONPath expressions.
Frequently asked questions
Is my JSON sent to a server?
How big a file can I format?
What does "Repair" do?
// line and /* block */ comments, and unquoted keys. After repairing, it shows a list of what it changed.Can I share my formatted JSON via a link?
#). Because URL hashes are never sent to the server, the data still stays in the browser. Large payloads can't be shared this way — use Download instead.What's the difference between format, beautify, and pretty-print?
Do you use cookies or tracking?
localStorage to remember your theme and indent preferences. We don't set tracking cookies, fingerprint your browser, or analyze your JSON content. If we add ads in the future, we'll display a consent banner first as required by law in the EU and California.Why does my number lose precision after formatting?
JSON.parse converts every number to a 64-bit float. Numbers larger than 253−1 (about 9 quadrillion) lose precision. If you're working with big IDs, transmit them as strings — that's a JSON design choice, not a bug in any formatter. See our note on JSON number precision and the BigInt problem.Is this JSON formatter free? Is there a download?
How do I beautify or pretty-print JSON from the command line?
python -m json.tool file.json, jq . file.json, or Node's JSON.stringify(obj, null, 2) all pretty-print. Our JSON formatting standards post covers indentation choices.Keyboard shortcuts
- Ctrl+Enter — Format / Beautify / Pretty-print
- Ctrl+M — Minify / Compact
- Tab in the input — insert two spaces
Related JSON tools
JSON Validator
Check JSON syntax with line + column error pointers — a strict RFC 8259 JSON syntax checker.
JSON Schema Validator
Validate JSON data against a JSON Schema (draft-07 / 2020-12 subset) with exact error paths.
JSON Diff
Compare two JSON documents structurally — see only the paths that actually changed.