Skip to content

Format JSON

Paste some JSON: it is indented as you type. If it contains an error we tell you the line and column — the only thing you actually need when a two-thousand-line file will not open.

Your text stays on your device: nothing is uploaded

0 characters

Result

Paste something on the left: the result appears as you type.

How it works

The text is parsed by the browser’s own JSON engine, the same one the receiving program will use: if we accept it, so will it. When parsing fails we translate the error position from “character 4172” into a line and a column, because that is how you search in an editor. Sorting keys is for comparing two files that should be identical: two exports of the same configuration often differ only in order, and sorting them makes the real difference stand out. Arrays are never reordered, because there the order is the content. The text is not sent anywhere: everything happens on this page.

Frequently asked questions

Does it accept comments, trailing commas or single quotes?
No: this is strict JSON, the kind programs read, and each of those is reported as an error. To fix them in one go, paste the text into “Convert YAML and JSON”: trailing commas, single quotes, unquoted keys and comments (#, // or /* */) disappear, and valid JSON comes out.
The error points to a line that looks fine. Why?
The position is where reading stopped, and the mistake is often just before it: a comma forgotten at the end of the previous line, a bracket opened and never closed, a missing quote. Check the line shown and the one above it.
Do numbers stay written exactly as before?
Yes: only spaces, line breaks and indentation change. Numbers and strings come out character for character as you wrote them — 1.50 stays 1.50, 1e3 stays 1e3 and a twenty-digit ID keeps its last digits — and keys stay in their order unless you ask for them to be sorted.
How do I squeeze the JSON onto a single line?
Pick “Minified” under “Indentation”: spaces and line breaks disappear. Under the result you see how many keys it holds, how deeply it’s nested and how much it weighs, so you can compare its size with the indented version.

What you paste is never uploaded. Anywhere.

The text you type stays in your browser’s memory: no request goes out while you type. You can paste something confidential.

  • Processed locallyEverything happens on this page.
  • Nothing to upload, nothing to wait forNothing to upload, no waiting.
  • Nothing to deleteWe keep nothing: nothing reaches us.
YOUR DEVICEyour fileprocessingthe resultservernever gets here

Other tools in this category