JSON formatter

Paste your JSON and get the result instantly: formatted, minified, or validated, with clear error messages that tell you where the problem is.

Indentation

Paste some JSON, drag in a file, or try the example. The result updates as you type.

View

Step by step

How to use it

  1. Paste your JSON into the input, drag in a file, or select “Example”. The result updates as you type.
  2. Choose the indentation (2 spaces, 4 spaces, tab) or minify. You can also sort the keys from A to Z.
  3. If there is an error, you get the line and column with a hint. Use “Repair” to see the proposed changes before applying them.
  4. Switch to “Tree” to explore the JSON, search for keys or values, and copy the path to any item.
  5. Copy the result, download it, or convert it to YAML, XML, or a JavaScript object.
FAQ

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting happen in your browser. You can paste private data with confidence: nothing leaves your device.

Why do my large numbers stay the same?

Many formatters read JSON as JavaScript objects and lose precision: 12345678901234567890 turns into 12345678901234567000. This formatter keeps the original text of every number, so large integers and decimals come out exactly as you wrote them.

Which errors does it detect, and how are they explained?

Trailing commas, single quotes, unquoted keys, comments, undefined and NaN, line breaks inside strings, unclosed braces, and more. Each error shows the line and column and explains in plain English how to fix it.

What does the Repair button do?

It tries to automatically fix common errors, such as trailing commas, single quotes, or comments. Before anything is applied, you see the proposed changes so you can decide.

Can I open large files?

Yes. Files of several megabytes are processed in the background, without freezing the page, and a progress bar shows how far along it is. If the result is huge, the editor shows only the beginning, and Copy and Download include everything.

Does it warn about duplicate keys?

Yes. JSON allows repeating a key inside an object, but it is almost always a mistake: when the data is read, the last value overrides the earlier ones. You see which keys repeat and on which line.

What formatting JSON is for

JSON is the format almost every API and configuration file uses to exchange data. When it arrives minified, on a single line, it is impossible to read. Formatting it with indentation lets you see the structure, spot errors, and compare changes.

Most common errors

  • Trailing comma: [1, 2, ] is not valid in JSON, even though JavaScript accepts it.
  • Single quotes: keys and strings always go in double quotes.
  • Unquoted keys: {name: "Ann"} is a JavaScript object, not JSON.
  • Comments: JSON does not allow // or /* */.
  • undefined, NaN, and Infinity: they do not exist in JSON; use null instead.

Minify, format, and validate

Minifying removes spaces and line breaks so the file is smaller. Formatting does the opposite so a person can read it. Validating checks that the text follows the rules of JSON. Here all three happen at once, on the same text.

Updated on September 29, 2026