Skip to content

JSON Formatter & Validator

Pretty-prints, minifies and validates JSON, pointing at the exact line and column of a syntax error.

Paste JSON and it is parsed, checked and re-printed — indented, minified, or as one object per line for streaming tools. When it does not parse you get the line and column with the offending character marked, and a repair pass that names each thing it would change rather than silently rewriting your document.

🔒 Runs entirely in your browserjsonformatvalidatebeautify
Output

Indented, one value per line.

Indent

Input

Drop a .json file

Read in this tab. Nothing is uploaded.

Output

Waiting for input.

How to use it

  1. Paste or drop the document

    The text box takes a paste; the drop zone under it takes a .json or .jsonl file. Either way the file is read in this tab and nothing is uploaded.

  2. Choose what the output should be

    Format for reading and diffing, Minify for shipping over the wire, JSON Lines when the consumer wants one array element per line. Indent width only applies to Format.

  3. Turn on key sorting when you are diffing

    Two exports of the same data often differ only in key order. Sorting deeply, in code-unit order, makes them byte-identical so the diff shows the real change.

  4. Read the fault, or apply the repair

    A syntax error is shown with the surrounding lines and a caret under the character. If the mistakes are ones the repair pass recognises — a trailing comma, a single quote, an unquoted key — it lists them and can apply them into the input box so you can see the diff before you copy.

Common questions

Why did a large number come out different?

This parses with the browser's own JSON parser, so every number becomes a double. An id like 9007199254740993 loses its last digit and there is no way to get it back from the parsed value. If your document carries 64-bit ids, keep them as strings.

Does the repair guarantee valid JSON?

No, and it says so. It fixes the mistakes it recognises; if the result still does not parse the panel tells you that instead of offering to apply it. It is a shortcut for the common typos, not a lenient parser.

How big a file can it take?

A few megabytes is comfortable. The parse is native and runs on the main thread after a short pause in typing, so a 5 MB document costs one dropped frame; past roughly 20 MB the browser tab, not the tool, becomes the limit.

Are comments allowed?

Not in JSON, so a document with // or /* */ fails to parse. The repair pass strips them, which is the usual way to get a JSONC config through here.

Feed it from

Next

These accept what this tool produces, so the result can go straight in.