Free JSON Formatter & Validator

Paste messy or minified JSON and get clean, indented output — with validation that points at the exact line and column of the first error. Free, no signup, nothing uploaded.

Honest limits — read first: This tool validates with the browser's JSON parser, so it follows strict JSON (RFC 8259) only. It does not auto-fix broken JSON — trailing commas, single quotes, unquoted keys, comments and Python values (True, None, NaN) are all invalid and must be fixed by hand; the error panel tells you exactly where. Do not paste secrets, tokens or customer data into any online formatter — this one runs locally, but the warning applies everywhere.

Your JSON

Ready. Paste your JSON and press Format.

Formatted output

Formatted JSON appears here…

The problem: one trailing comma breaks everything

Every developer has lived this moment: you paste a payload into a formatter, click Format, and get “Error: Parse error on line 42 — expecting STRING, got }” — because of one tiny trailing comma. Now you have to hunt the error down by hand, fix it, and try again. That is the number-one complaint about JSON tools, and the second is privacy: developers paste production API responses containing user data — sometimes database credentials — into a random website that probably logs it. The third is the tools that only say “invalid” and offer no help: no line number, no column, no hint about which of the five usual mistakes it is. What developers actually want is a formatter that points at the exact character, names the likely cause, and never sends their data anywhere — plus minify for transport and sort-keys for stable diffs.

How do I format and validate JSON online?

Paste your JSON above and press Format — it is beautified with your chosen indentation and validated at the same time. If it is invalid, the status line shows the exact line and column of the first error, with the line shown and a caret (^) under the problem character, plus the most likely cause. Press Minify to compress it to one line. It is free, with no signup, and everything runs in your browser.

A JSON formatter (also called a JSON beautifier or pretty printer) takes raw, compressed JSON and reformats it with consistent indentation and line breaks so it is easy to read, review and debug. A validator confirms the syntax is correct. This tool does both, and minifies too — all in your browser, with nothing uploaded to a server.

How to format JSON in 3 steps

Step 1: paste your JSON into the input box. Step 2: choose an indentation (2 spaces, 4 spaces or tab) and press Format — or Minify to compress it. Step 3: if there is an error, read the line and column, fix the character under the caret, and press Format again. Then copy or download the result.

Format vs minify vs validate — when to use each

Format (beautify): use when you want to read JSON — inspecting an API response, reviewing a config file, or debugging a data feed. Minify: use when you want the smallest output — reducing payload size, embedding JSON compactly, or storing it on a single line. Validate: happens every time you press Format; the status flags valid or invalid, and an invalid result shows the parser's message with the position of the first syntax error, so you catch mistakes before shipping.

The 5 most common JSON errors

ErrorExampleFix
Trailing comma{ "a": "b", }Delete the comma before } or ]
Single quotes{ 'key': 'value' }Use double quotes for keys and strings
Unquoted keys{ key: "value" }Quote every key: { "key": "value" }
Comments{ // note "a": 1 }JSON has no comments — remove them
Wrong true/false/null{ "x": True }Use lowercase true, false, null

JSON vs a JavaScript object — spot the differences

A JavaScript object literal and JSON look almost identical, which is why so much invalid JSON starts life as copied JavaScript. JSON is a strict subset: a JS object allows single quotes, unquoted keys, trailing commas, comments, undefined and NaN. JSON allows none of those. Same object, two syntaxes:

FeatureJavaScript object — validJSON — invalid
QuotesSingle or double quotesDouble quotes only, for keys and string values
KeysUnquoted keys allowed: { name: "Ava" }Every key must be quoted: { "name": "Ava" }
Trailing commaAllowed since ES5Not allowed — kills the whole file
Comments// and /* */ allowedNo comment syntax at all
Valuesundefined, NaN, Infinity allowedUse null or a number instead
Booleanstrue / falsetrue / false — but not Python's True / False / None

Format JSON without a website

If you would rather not paste a payload into any web page at all, the same check runs locally. In a browser console, paste the JSON into JSON.parse('...') — the error message tells you the exact character position where it broke. In a terminal, python3 -m json.tool pretty-prints a file, and jq . does the same with far more power. This page is the same idea with a friendlier error: the line, the column, and the likely cause, instead of a bare parser message.

FAQ

Is this JSON formatter free?

Yes. Format, validate and minify as much JSON as you like, free, with no signup, no account and no limits.

What is a JSON formatter?

A tool that takes raw, compressed JSON and reformats it with consistent indentation and line breaks so it is easy to read, review, and debug. Also called a beautifier or pretty printer.

What is the difference between format, minify, and validate?

Format means pretty-print for reading; minify means compress to one line for smallest size; validate means confirm the syntax is correct. This tool does all three — validation happens every time you press Format.

How do I fix invalid JSON?

Find the first error and fix that one thing — the parser stops at the first error, so fix and revalidate one at a time. The usual culprits are a trailing comma, single quotes, an unquoted key, a comment, or a Python-style True or None. This tool shows the line, the column and the likely cause.

Why is my JSON invalid — trailing comma?

JSON does not allow a comma after the last item in an object or array, even though JavaScript does. Delete it. It is the single most common JSON error.

Can JSON use single quotes?

No. Keys and string values must use double quotes — no exceptions. JavaScript allows both; JSON only allows double quotes.

Can I put comments in JSON?

No — JSON has no comment syntax. Neither // single-line comments nor /* */ block comments are valid anywhere in a JSON document. Use JSONC in your editor if you need comments, but strip them before sending to an API.

What is the difference between JSON and a JavaScript object?

A JavaScript object allows single quotes, unquoted keys, trailing commas, comments, undefined and NaN. JSON allows none of those — it is a strict subset of JavaScript object syntax.

How do I format JSON in the browser console?

Paste it into JSON.parse('...') — the error message tells you the exact character position where it broke. Or use python3 -m json.tool or jq . in the terminal. This page is the same idea with a friendlier error: line, column and likely cause.

How do I minify JSON?

Remove all unnecessary whitespace — one click in a formatter. Minify for production payloads, format for reading.

Is it safe to paste JSON into an online formatter?

Only if it runs client-side. Nothing you paste here is uploaded — this tool uses the browser's built-in JSON parser, which matters when the payload contains API keys, customer records, or internal responses. If a page does not say processing is local, do not paste secrets into it.

What is JSONPath?

A query language to extract values from JSON — for example, pull one field out of a large response without copying the whole blob. This tool does not have a JSONPath filter; use it to format and validate, then query the result elsewhere.

What indent should I use — 2 spaces or 4?

2-space indent is the most common. Tabs are fine too. What matters is consistency — mixed indentation makes diffs unreadable.

Can a formatter fix my JSON automatically?

Only mechanical errors: trailing commas, single quotes, unquoted keys, missing brackets. It cannot fix wrong values, wrong structure, or missing data — that is your data, not syntax. This tool does not auto-fix at all: it points at the first error and tells you the likely cause, and you fix it yourself.

What does "Unexpected token }" mean?

Usually a trailing comma or a missing value before the closing brace — the parser found } where it expected another property or value. Check the character just before the }.

Related questions

Why does JSON not allow trailing commas? The JSON standard (RFC 8259) simply does not include them. JavaScript objects allow them, which is why they creep in — but a JSON parser rejects them.

Can JSON have comments? No. JSON has no comments. If you need them, use JSONC in your editor — but strip them before sending the data to an API.

What indent should I use for JSON? 2-space indent is the most common. Tabs are fine too — what matters is consistency, because mixed indentation makes diffs unreadable.

How big a file can I format here? There is no server limit, but very large pastes (many megabytes) can slow the browser tab. For huge files, a desktop tool or jq is faster.