JSON Formatter and Beautifier

Paste messy JSON, get clean, indented JSON back instantly. Nothing leaves your browser.

Input
Output
Formatted JSON will appear here.

What is JSON Formatter?

A JSON formatter (also called a JSON beautifier) takes JSON text that's been minified, copy-pasted from a log, or squashed onto one line, and re-indents it into a readable, consistently-spaced structure.

JSON itself doesn't care about whitespace — {"a":1} and a version spread across ten indented lines are identical to any program reading it. The formatting is purely for humans: it makes nested objects and arrays easy to scan, and makes a structural mistake (a missing comma, an unclosed brace) immediately obvious instead of invisible in a 2,000-character single line.

How to use it

  1. Paste or type your JSON into the Input panel on the left.
  2. Pick an indent size (2 spaces, 4 spaces, or a tab) from the dropdown.
  3. Click "Beautify" to pretty-print it, or "Minify" to collapse it to the smallest possible single line.
  4. If the JSON is invalid, the error message shows what went wrong instead of any output.
  5. Click "Copy" to copy the result to your clipboard.

How it works

The formatter parses your input with the browser's built-in JSON parser, which validates the structure completely before anything is reformatted — if parsing fails, you get the exact error instead of a best-effort guess.

Once parsed, it's re-serialized with the indentation you chose. Beautify re-serializes with line breaks and spacing; Minify re-serializes with none. Because this happens entirely in your browser, no part of your JSON — including anything sensitive — is ever sent anywhere.

Example

Minified input:

{"id":1,"name":"Ada","roles":["admin","editor"]}
↓ Beautify (2 spaces) ↓
{
"id": 1,
"name": "Ada",
"roles": [
"admin",
"editor"
]
}

Frequently asked questions

Is my JSON uploaded anywhere?

No. Formatting happens entirely in your browser using JavaScript's built-in JSON parser — nothing you paste is sent to a server.

Why does it say my JSON is invalid?

JSON has strict rules: keys must be double-quoted, trailing commas aren't allowed, and single quotes aren't valid. The error message includes the exact position JavaScript's parser stopped at, which is usually right next to the actual mistake.

What's the difference between formatting and minifying?

Formatting (beautifying) adds indentation and line breaks for readability. Minifying strips all unnecessary whitespace to produce the smallest possible output — useful for reducing payload size before sending JSON over a network.

Can I format very large JSON files?

Yes, within your browser's memory limits — there's no server-side size cap since nothing is uploaded. Extremely large files (tens of megabytes) may be slow to render in the browser.

Does it support JSON5 or JSONC (comments)?

No — this tool validates and formats strict, standard JSON only, matching what JSON.parse() in JavaScript accepts.