Format JSON without uploading it. Exact errors, big numbers kept.

Paste JSON below — beautify, minify, sort keys, or find the exact line and column of a syntax error. Runs entirely in your browser.

  • Exact line & column errors
  • Big numbers kept digit-for-digit
  • One-click repair
  • Free, no account

Format, validate and minify JSON

Options
About the samples and file limits

Indentation applies to Format and Sort keys. Minify always strips all whitespace.

The broken sample has single quotes, unquoted keys and trailing commas — click Repair and watch it fix all three. Files over 5 MB are refused; pastes of any size are accepted, but live checking pauses above 200 KB.

Paste JSON above to check it

Formatted output

Your formatted JSON appears here. Paste JSON on the left and click Format — or try a sample above.

Privacy you can verify, not just trust

Most online JSON formatters send what you paste to their server — and API responses often contain tokens, keys and personal data. This one can't: the parser runs entirely in your browser. Your JSON is never sent anywhere — the only requests to other sites are the site's own analytics, which count page views — and it uploads nothing, ever. Nothing is stored either: reload the page and your JSON is gone. Don't take our word for it:

External requests during processing: 0
  1. Press F12 to open developer tools, then the Network tab.
  2. Paste and format any JSON above. Watch: apart from the site's analytics, nothing new is requested — no uploads, and no JSON ever leaves your device.
  3. Extra credit: disconnect your internet after this page loads — formatting still works.

How to format and validate JSON

JSON is the format APIs, config files and databases use to move structured data around — and it is strict. One misplaced comma and the whole document is rejected, usually with an error message that names a position but not the mistake. This tool closes that gap: paste the text, and it either formats it or shows the first error with its exact line and column, the offending line, and a caret under the offending character, plus a plain-English explanation of what went wrong and how to fix it.

  1. Paste your JSON into the box above, or open a .json file. Validation runs as you type.
  2. Read the verdict. Valid JSON shows its type, size and structure. Invalid JSON shows the error, its position, and a caret — click Jump to the error to land on it in the editor.
  3. Format, Minify or Sort keys — or click Repair if the input is JSON-ish but not quite JSON (see below).
  4. Copy or download the result. Nothing you pasted is stored anywhere.

The three errors that break almost every pasted JSON

Nearly every invalid JSON document a developer pastes has one of three causes, and all three come from copying text out of a programming language instead of out of a JSON document.

1. Trailing commas. JavaScript object literals allow a comma after the last item; JSON does not. This is the single most common error in pasted API payloads:

{ "name": "Ada", "age": 36, }   ← the comma after 36 is illegal in JSON
{ "name": "Ada", "age": 36 }    ← remove it and the document is valid

2. Single quotes. JavaScript and Python both accept single-quoted strings; JSON accepts only double quotes — for keys as well as values:

{ 'name': 'Ada' }   ← invalid: single quotes
{ "name": "Ada" }   ← valid: double quotes

3. Unquoted keys. In JavaScript you can write {name: "Ada"}; in JSON the key must be a quoted string:

{ name: "Ada" }     ← invalid: the key is bare
{ "name": "Ada" }   ← valid: the key is quoted

Click Repair and the tool fixes all three at once — it strips trailing commas, converts single-quoted strings and keys to double quotes, quotes bare keys and bare words used as values, and removes // and /* */ comments — then re-validates and tells you exactly what it changed. If the result still does not parse, it shows the remaining error instead of pretending the fix worked.

Why large numbers change in most formatters

Most formatters run your JSON through JSON.parse, which converts every number into a JavaScript 64-bit floating-point number. A double holds about 15–16 significant digits exactly — anything longer is rounded, silently. An order ID of 9007199254740993 becomes 9007199254740992, and a price of 1.10 becomes 1.1. For IDs, order numbers and money, that is data corruption, and no error is ever shown. This tool never converts a number to a JavaScript number: it keeps each numeric literal exactly as you typed it and re-prints it digit-for-digit. When a number is large enough that other formatters would have rounded it, an amber notice names it, so you know what was protected.

Duplicate keys: the silent bug

JSON technically allows the same key twice in one object, but almost every parser keeps only the last value and drops the earlier one without a word — so {"id": 1, "id": 2} reads as {"id": 2} and the first value vanishes. That usually means a copy-paste error or two systems writing the same field. This tool flags every duplicate key with its line and column, and keeps both copies in the formatted output, so you can see the conflict instead of discovering it in production.

Format, minify, or sort keys — which do you need?

Format is for reading: it re-prints a minified API response with indentation and line breaks. Minify is for sending: it strips every byte of whitespace for the smallest valid document, which is what you paste into a request body or store. Sort keys is for comparing: alphabetical keys at every level make two versions of the same document diff cleanly, instead of hiding a one-value change inside a re-ordered object. All three leave values untouched — including large numbers, which stay exactly as written.

Honest limitations

No schema validation

This tool checks syntax only — whether the text is well-formed JSON. It does not check whether the data matches a JSON Schema, an API contract, or your expected shape.

Repair is best effort

Repair fixes the common JSON-ish mistakes. It cannot invent a missing value, close a string it cannot find the end of, or guess what a garbled document was meant to say — and it says so when it fails.

Very large pastes are slower

Formatting itself is fast, but syntax highlighting runs on the main thread, so a multi-megabyte paste can feel sluggish. Live checking pauses above 200 KB; use the Format button instead. Files over 5 MB are refused outright.

Strict JSON, not JSON5 or JSONC

Comments, trailing commas and single quotes are repaired, not accepted as valid. If you work with JSON5, JSONC or NDJSON daily, those formats need a dedicated parser — pasting them here will report the first non-JSON construct as an error.

Frequently asked questions

How do I format JSON online without uploading it?

Paste your JSON into the box above and click Format. Everything runs as JavaScript in your own browser: the text is parsed, formatted and displayed on your device, and no JSON you paste is sent to any server. The only requests to other sites are the site's own analytics, which count page views. You can verify this in your browser's Network tab — paste and format, and no new request appears apart from analytics.

Why does my JSON say 'trailing comma' and how do I fix it?

A trailing comma is a comma after the last item in an object or array, for example {"a": 1,}. JavaScript object literals allow it, so it creeps in when JSON is copied from code — but the JSON specification forbids it, so every strict parser stops there. Delete the comma, or click Repair above and the tool removes every trailing comma for you and re-checks the result.

Can I use single quotes in JSON?

No. JSON strings and object keys must use double quotes: {"name": "Ada"} is valid, {'name': 'Ada'} is not. Single quotes usually arrive when JSON is copied from a JavaScript object literal or a Python dictionary. Click Repair to convert every single-quoted string and key to double quotes automatically, or replace them by hand.

Why do large numbers change when I format JSON?

Most formatters parse numbers into JavaScript's 64-bit floating-point numbers, which hold about 15–16 significant digits exactly. Anything longer gets rounded: 9007199254740993 becomes 9007199254740992, and 1.10 becomes 1.1. That silently corrupts IDs, order numbers and money amounts. This tool never converts a number to a JavaScript number — it keeps the literal exactly as you typed it, re-prints it digit-for-digit, and warns you whenever a number is large enough that other formatters would have rounded it.

What happens if my JSON has the same key twice?

JSON allows the same key twice in one object, but almost every parser keeps only the last value and silently drops the earlier one — so {"id": 1, "id": 2} reads as {"id": 2} and the first value is gone without a warning. This tool flags every duplicate key with its line and column so you can decide which value you meant, and keeps both copies in the formatted output so nothing is hidden from you.

What is the difference between formatting, minifying and sorting keys?

Formatting (beautifying) adds indentation and line breaks so a minified API response is readable; it changes only whitespace, never data. Minifying does the reverse — it strips all whitespace to the smallest valid JSON, which is what you send over the network or store. Sorting keys re-orders object keys alphabetically (A–Z), which makes two versions of the same document easy to compare in a diff. All three leave your values untouched — including large numbers, which stay exactly as written.