JSON formatter

Paste JSON to format it, check it is valid, minify it to one line or sort its keys. Errors point to the exact line and column.

Your files stay on your device. Nothing is uploaded.

JSON formatter

Updates as you type
Format

Formatted JSON

Valid, formatted JSON appears here as you type. Click ▸ to open or close any object or list.

How to format JSON

  1. Paste your JSON

    Paste JSON into the first box, for example an API response or a config file.

  2. Choose the layout

    Pick 2 spaces, 4 spaces, tabs or minify, and whether to sort keys A to Z.

  3. Copy or download

    The formatted JSON appears as you type. Copy it or download a .json file.

About this tool

Errors you can fix

Invalid JSON shows what is wrong and where, for example "Line 4, column 12: expected a comma". Common causes: a trailing comma, single quotes instead of double quotes, or a missing bracket.

Long numbers stay exact

Many formatters turn 12345678901234567890 into 12345678901234567000, because JavaScript numbers have about 15 digits. This one keeps every digit, so IDs and amounts are never changed.

Minify for size

Minify removes all spaces and line breaks, which makes JSON smaller to send or store. Sorting keys makes two JSON files easy to compare with Text compare.

Privacy

This tool runs in your browser, on your own device. Your files and text are not uploaded to our server and we cannot see them. When you close or reload this tab, they are cleared, along with the results.

Frequently asked questions

Does it change my data?

No. Only spacing changes (and key order, if you choose to sort).

Can I convert JSON to other formats?
Is my JSON uploaded?

No. It runs in your browser, so nothing you type is sent anywhere.

Are comments allowed?

No. Standard JSON has no comments, so a // or /* comment is reported as an error.