JSON Formatter

Paste JSON to check that it is valid and make it easy to read. The formatter indents every level, can sort keys A to Z, or minify the JSON onto one line. If something is wrong, it tells you the line and column.

Your JSON

Output

Formatted JSON

    How to use the JSON Formatter

    1. Paste your JSON into the box, or use Try an example.
    2. Choose Beautify or Minify and the indent you want.
    3. Copy the result or download it as a .json file.

    Your data stays on your device. This tool runs entirely in your browser. Nothing you type or paste is sent to our server or saved. Read our privacy policy.

    What makes JSON valid?

    JSON (JavaScript Object Notation) is the most common format for APIs and config files. It is strict, and most errors come from a few rules:

    • Keys and strings use double quotes: "name", not 'name'.
    • No trailing commas after the last item in an object or array.
    • No comments. // and /* */ aren't allowed.
    • Only true, false, null, numbers, strings, arrays and objects. undefined, NaN and functions are not JSON.

    When something is wrong, the formatter shows the line and column where reading stopped. The real mistake is usually just before that point.

    Beautify or minify?

    BeautifyMinify
    Looks likeIndented, one value per lineEverything on one line
    Use forReading, debugging, code reviewsSending over a network, storing
    SizeLargerSmallest

    Sorting keys A to Z makes two JSON files easy to compare with a diff tool.

    Is it safe to paste API responses?

    Yes. Formatting happens in your browser and nothing is sent to a server, so tokens, customer data and config secrets stay on your machine.

    Related tools

    Turn a JSON array into a spreadsheet with JSON to CSV, or encode a JSON payload with the Base64 Encoder.

    Frequently asked questions

    Is my JSON sent to a server?

    No. The JSON is checked and formatted in your browser, so private data such as API responses or config files never leaves your device.

    Why does it say my JSON isn’t valid?

    JSON is strict. The usual causes are single quotes instead of double quotes, a comma after the last item, missing commas between items, or comments, which JSON doesn’t allow. The error message shows the line and column where reading stopped.

    What is the difference between Beautify and Minify?

    Beautify adds line breaks and indentation so people can read the JSON. Minify removes all spaces and line breaks to make the file as small as possible for sending over the internet. Both contain exactly the same data.