Toolpuffin

    Loading...

    Up and down to choose, Enter to open, Esc to close.

    How to Format and Validate JSON (and Fix Common Errors)

    Updated October 2026

    Written by the Toolpuffin team. Tools in this guide are tested in the browser.

    JSON that arrives as one long line is almost impossible to read, and one missing quote makes a whole file fail. A JSON formatter turns the long line into a clear, indented structure and tells you where the problem is when something is wrong. It can be done on your own device, so private data is not sent anywhere.

    Format JSON in three steps

    1. Open the JSON Formatter.
    2. Paste your JSON into the input box.
    3. Choose Format, Minify or Validate, and copy the result.

    Formatting only changes whitespace. The keys stay in the same order and the values are not touched.

    Format, minify or validate?

    ChooseWhen you want toResult
    FormatRead or edit the JSONIndented, one item per line (2 spaces, 4 spaces or tabs)
    MinifySend or store the JSON in the smallest formEverything on a single line
    ValidateCheck whether the JSON is correctA yes, or an error message that points to where parsing failed

    The most common JSON errors

    Standard JSON is strict. These are the mistakes that cause most error messages:

    MistakeWrongRight
    Trailing comma{"a": 1,}{"a": 1}
    Single quotes{'a': 1}{"a": 1}
    Key without quotes{a: 1}{"a": 1}
    Comment in the file{"a": 1} // noteRemove the comment

    If the error message points to a place that looks fine, look at the line just before it. A missing comma or a missing closing bracket is usually reported where the parser gets confused, not where the mistake was made.

    Is it safe to paste private data?

    The JSON is parsed in your browser and is not sent to a server. That makes it a reasonable choice for payloads that contain names, tokens or other internal data. As a general habit, still remove real secrets such as passwords and API keys before you paste anything anywhere.

    Related helpers

    JSON often contains encoded text. If you find a long string of letters and numbers that ends in one or two equals signs, it may be Base64.

    Further reading

    More guides