Home Developer Tools JSON Formatter

JSON Formatter

The only JSON formatter that explains errors in plain English. Format, validate, minify, explore as a tree, and query with JSONPath — all running privately in your browser.

Always Free No Signup Zero Upload Plain-English Errors

What's inside

  • Live format
  • Tree view
  • JSONPath
  • Minify
  • File upload
  • Error fixer
  • Sort keys
  • History
Runs in your browser — your JSON never leaves your device
Errors explained in plain English with fix suggestions
Works on mobile — drag, drop, tap, done
Indent
Input · Raw JSON
1
Output · Formatted
{ } Your formatted JSON will appear here
waiting 0 B 0 lines 0 keys depth 0
Invalid JSON line 1
Plain English
How to fix
Where it broke

Valid JSON

Your JSON parses cleanly. Ready to copy, download, or explore as a tree.

Paste valid JSON in the input above, then come back here to explore it as an interactive tree.
Input · Any JSON
Output · Minified
→ ← Minified JSON will appear here
before: 0 B after: 0 B saved: 0 B

Recent JSON 0

No saved JSON yet. Format something and click Save in the toolbar to keep it here.

Every JSON error, explained

The 9 errors that trip up almost every developer — what they really mean, and the one-line fix. Click any card to load a broken example into the formatter.

Unexpected token }

Trailing comma

You left a comma after the last item. Legal in JavaScript, illegal in JSON.

{"name":"alice"} ← no comma
Unexpected token '

Single quotes used

JSON only allows double quotes. Single quotes are a JavaScript habit.

{"name":"alice"}
Unexpected token n

Unquoted key

Object keys must be wrapped in double quotes — even if they look like identifiers.

{"name":"alice"}
Unexpected token /

Comments in JSON

Standard JSON does not allow // or /* */ comments at all.

Remove all comments before parsing
Unexpected end of input

Missing closing bracket

You opened a { or [ but never closed it. Often happens when copying partial responses.

{"a":1} ← add the missing brace
Unexpected number

Malformed number

Numbers can have only one decimal point. Also: no leading zeros, no NaN, no Infinity.

{"price": 12.50}
Unexpected token n

JavaScript values

JSON can only hold strings, numbers, booleans, null, arrays, and objects. No functions, no new Date(), no undefined.

{"date": "2026-05-24"}
Unexpected token w

Unescaped quotes in string

A double quote inside a string value must be escaped with a backslash.

"hello \"world\""
Unexpected token {

Multiple JSON objects

One file = one JSON value. For multiple objects, wrap them in an array [...].

[{"a":1},{"b":2}]

Most JSON formatters
just format. Ours teaches.

Built for developers who want answers, not "Unexpected token at position 47."

Plain-English errors

Every error gets a human explanation plus a copyable fix. No more cryptic stack traces from JSON.parse.

"Trailing comma at line 5"

Interactive tree view

Click any key to copy its JSONPath. Collapse deeply nested objects so you can navigate API responses sanely.

Click → $.users[0].email copied

JSONPath query bar

Pull values from anywhere in a giant JSON without scrolling. Test queries before pasting them into your code.

$.products[*].price

Nothing uploaded

Other formatters POST your JSON to a server. Ours parses everything client-side. Your API keys and PII stay on your machine.

0 network requests · verified

Actually works on phone

Most JSON tools are desktop-only afterthoughts. Ours adapts to phones — paste, format, tap to copy.

Responsive · touch-friendly

Format + Minify + Tree, one page

Three tools in one — toggle modes without losing your data. History panel keeps your last 10 inputs.

No reload · no relogin · ever

Format any JSON in 4 steps

Under 30 seconds. Works with broken JSON, minified blobs, API responses, and config files.

1

Paste or drop

Paste raw JSON in the left panel, or drag a .json file anywhere on the page.

2

Read the result

Valid JSON formats live on the right. Invalid JSON shows a plain-English explanation of what broke.

3

Tweak indent or sort keys

Change between 2 spaces, 4 spaces, or tabs. Sort object keys alphabetically with one click.

4

Copy, download, or query

Copy to clipboard, download as .json, switch to tree view, or pull values with JSONPath.

JSON questions,
answered.

Everything developers ask about formatting, validating, and working with JSON — explained without jargon.

Ask a question
A JSON formatter takes raw or minified JSON and rewrites it with proper indentation, line breaks, and spacing so it is easy for humans to read. It also validates the JSON and reports any syntax errors. Our formatter goes one step further — when there is an error, it explains what broke in plain English instead of dumping a cryptic JavaScript error.
No. All parsing, formatting, validation, JSONPath queries, and tree rendering happen entirely inside your browser using JavaScript. Your JSON never leaves your device. You can verify this in DevTools → Network: zero requests are made while you use the tool. Important for anyone working with API responses that contain tokens, PII, or other sensitive data.
Formatting (also called beautifying or prettifying) adds spaces and line breaks so the JSON is easy for humans to read. Minifying removes every unnecessary whitespace character to make the file as small as possible — useful for production APIs, network transmission, and embedding JSON in HTML attributes. Same data, different shape.
JSONPath is a query syntax for JSON — think of it as XPath for XML. $ is the root, . drills into an object, [0] picks the first item of an array, and [*] matches all items. So $.users[0].email grabs the email of the first user, and $.products[*].price grabs every product price. Type a query in the bar above and the result appears live.
The four classic offenders: trailing commas (legal in JavaScript, illegal in JSON), single quotes instead of double quotes, unquoted object keys, and comments (standard JSON has none). The Error Dictionary further up the page has the full list with examples. The formatter also highlights the exact line and explains the fix.
Yes. You can paste, drag and drop, or upload .json files up to several megabytes and they format instantly in modern browsers. Very large files (50MB+) may make the tree view slow, but formatting, validation, and JSONPath remain fast. For huge files, switch to Minify mode — it has no rendering overhead.
Sorting keys produces deterministic JSON — the same data always serializes to the same string. That matters when you want to diff two JSON files, compute a stable hash, or store JSON in version control without noisy git diffs from random key reordering. Click "Sort keys" in the toolbar to enable.
Right now the formatter follows the strict RFC 8259 JSON specification — no comments, no trailing commas, no unquoted keys. That matches what JSON.parse accepts in browsers and Node.js. JSON5 (relaxed superset), JSONC (with comments), and NDJSON (one JSON per line) are on the roadmap. Vote for which one you need most.

Drop your .json file

Up to a few MB · parsed entirely in your browser