JSON formatter

Make JSON readable, compact it, or find out why it is invalid.

This tool needs JavaScript. Please turn it on in your browser.

How to use it

  1. Step 1

    Paste your JSON into the first box.

  2. Step 2

    Press Format to indent it, or Minify to remove all extra spaces.

  3. Step 3

    If the JSON is invalid, read the message to find the problem.

  4. Step 4

    Copy the result.

About this tool

JSON is the text format used by most web APIs and configuration files. Compact JSON is hard to read, so formatting adds line breaks and indentation. Minifying does the opposite and makes it as small as possible for sending.

Validation uses your browser's own JSON parser, so it follows the official rules: keys and strings need double quotes, and trailing commas and comments are not allowed. The error message points to where parsing failed.

API responses and config files can contain private data, so this tool works entirely on your device and nothing is sent to a server.

Questions

Why is my JSON invalid?

Common causes are single quotes instead of double quotes, a trailing comma, a missing comma between items, or unquoted keys.

Can it handle large files?

Yes, up to what your browser can hold in memory. Very large documents may be slow to display.

Does formatting change my data?

No. Only spaces and line breaks change. Key order and values stay the same.

Is my JSON uploaded?

No. It is processed in your browser.

WhatsApp