fast&private

JSON Formatter and Validator

Format, indent and validate JSON.

Your data is never sent to any server.

The JSON formatter indents, validates and minifies JSON in your browser. Paste an API response or a config file and you will see it neatly laid out instantly; if it is not valid, it tells you the line and column of the problem. Nothing you paste leaves your device, which matters when the JSON carries tokens or personal data.

The mistakes that break JSON most often

MistakeWrongRight
Trailing comma{"a": 1,}{"a": 1}
Single quotes{'a': 1}{"a": 1}
Unquoted key{a: 1}{"a": 1}
Comments{"a": 1 // one}{"a": 1}
Values from other languages{"a": None}{"a": null}

All of them are valid in JavaScript or Python, which is why they turn up so often when you copy an object out of code. JSON is stricter: only double quotes, no comments or trailing commas, and the special values are written true, false and null, in lower case.

Validating without repairing

With Fix JSON ticked, a broken JSON comes out formatted as if nothing happened, and that is fine when you only want to read it. But if another program is going to consume that JSON, the original is still broken. In that case untick the box: you will see the exact error and can fix it at the source.

How to use JSON Formatter

  1. 1

    Paste your JSON

    It can be on a single line, minified or slightly broken. It is formatted and validated as soon as you paste it, without pressing any button.

  2. 2

    Choose the indentation

    2, 3 or 4 spaces to read it comfortably, or Compact to minify it onto a single line.

  3. 3

    Decide whether it should repair it

    The Fix JSON box is ticked by default and corrects the most common mistakes before formatting. Untick it if you want to validate the JSON as it is and see where it fails.

  4. 4

    Copy the result

    Press the copy button to take the formatted JSON.

Frequently asked questions

How do I find the error in an invalid JSON?

Untick Fix JSON and the tool tells you the line and column where parsing stopped. The mistake is usually right there or on the line before: a missing comma, an extra one or an unclosed quote.

What does Fix JSON correct?

The usual problems of JSON copied from JavaScript code or a log: single quotes instead of double, unquoted keys, trailing commas, comments and values such as Python's True or None. If the text is too broken, it tells you it could not repair it.

What is the difference between beautify and minify?

Beautifying adds line breaks and indentation so it reads well. Minifying removes every space that is not needed so it takes up as little as possible. The data is identical in both cases.

Is there a size limit?

There is no set limit. The only one is your browser's memory, and a JSON of several megabytes formats without trouble on an ordinary computer.

Is my JSON sent to any server?

No. Formatting and validation run in your browser, so you can paste API responses with tokens or customer data without them leaving your device.