JSON Formatter & Validator — online beautify / minify / validate / convert / diff (Util123)

JSON Formatterutil123.top/json/Beautify · Minify · Validate · Tree · Convert · Diff
Ready
Input JSON 0 chars
Drop to load a JSON file
Escape Click to edit the raw input directly
Code
Tree
Convert
Diff
JSONPath
Converts the JSON from the left input (for escape / Unicode conversion use the left “Escape” toolbar)
The left side defaults to the current input; paste another JSON on the right. Green = added, red = removed.
Supports $ .key [n] [*] $..key ['key']
Enter a JSONPath expression to query the current JSON; results are listed by path.
Ready Chars 0 Nodes — Depth — Keys — 100% client-side · nothing is uploaded · ⌘/Ctrl + Enter to format
AD · LEADERBOARD 728×90 (PLACEHOLDER — REPLACED WHEN ADSENSE GOES LIVE)

Formatting versus validating

These are separate operations and it is worth knowing which one failed:

The mistakes that break a document

WrittenProblem
{'key': 'value'}JSON requires double quotes — single quotes are a JavaScript habit
{"a": 1,}Trailing comma — allowed in JS, forbidden in JSON
// commentJSON has no comment syntax at all
{a: 1}Unquoted keys are invalid
{"n": 01}Leading zeros are not permitted on numbers
{"n": NaN}Not a number; JSON has no NaN or Infinity

The single most common cause of a "broken" API payload is a trailing comma left behind after deleting the last item.

JSON and its relatives

JSON5 and JSONC relax the rules to allow comments, trailing commas and single quotes — useful for configuration files, but they are not valid JSON and will be rejected by any strict parser. YAML is a superset that is easier to write by hand but full of its own ambiguities: the "Norway problem", where the country code NO is read as the boolean false, is the classic example. NDJSON puts one complete JSON object per line, which makes huge datasets streamable.

Structure beyond syntax

Valid JSON can still be the wrong shape. JSON Schema describes what a document is supposed to contain — required fields, types, ranges — so a payload can be checked against a contract rather than merely parsed. For anything exchanged between systems, a schema is what stops a field silently changing type.

Related tools

CSV ⇄ JSON XML formatter Text diff

FAQ

What features does this JSON formatter support?
Beautify (format), minify, real-time syntax validation with error location, syntax highlighting, a collapsible tree view, key/value search, key sorting, auto-repair of common syntax errors, conversion to YAML / CSV / XML, Unicode escape conversion, escape and unescape, a two-pane diff, and JSONPath queries.
Is my pasted JSON uploaded to a server?
No. All parsing, conversion and comparison happen locally in your browser — your data never leaves your machine.
How do I convert JSON to YAML, CSV or XML?
Switch to the YAML / CSV / XML tab in the output pane; Unicode escape conversion and escape/unescape live in the “Escape” toolbar on the left.
How large a JSON file can it handle?
It depends on the memory your browser has available; JSON up to a few megabytes formats smoothly. For very large files, minify or split them first.
Does it support JSONPath queries?
Yes. Enter an expression like $.store.book[0].title to extract the node you need from the result.