Skip to content

JSON Formatter

Formats messy or minified JSON into clean, indented, readable text, and points out any errors.

Your JSON stays on this device

This tool runs entirely inside your web browser. Your JSON is processed on your own device and is never sent to our servers. How this works

Formatted JSON

JSON Formatter is a free tool that turns compact or messy JSON into neatly indented text that is easy to read. It runs entirely in your browser: your JSON is never uploaded, and no account is needed. If the JSON has a mistake, it tells you exactly where.

How to format JSON

  1. Paste your JSON into the left box, open a .json file, or click Example.
  2. The formatted version appears on the right straight away.
  3. Choose 2 spaces, 4 spaces or tabs for indentation, and optionally sort keys alphabetically.
  4. Click Copy or Download to use the result.

Example

This single line of JSON, as it might come back from an API:

{"id":10482,"status":"shipped","items":[{"sku":"MUG","qty":1}]}

becomes:

{
  "id": 10482,
  "status": "shipped",
  "items": [
    {
      "sku": "MUG",
      "qty": 1
    }
  ]
}

When to use it

Your data is kept exactly as it is

Many online formatters parse JSON with JavaScript and print it back out. That quietly rounds large numbers:12345678901234567890 becomes 12345678901234567000, which can corrupt IDs from databases or APIs. This formatter copies every number and piece of text exactly as written and only changes the whitespace between them.

Common JSON errors and how to fix them

For a full list of every error in a document, use the JSON Validator. To make JSON smaller instead, use the JSON Minifier.

Frequently asked questions

Is my JSON sent to a server?

No. Formatting happens in your browser. Your JSON is not uploaded, stored or logged, which makes this safe for API responses, config files and data containing personal information.

Will formatting change my data?

No. Only spaces and line breaks change. Numbers and text are copied exactly as you wrote them, so large IDs such as 12345678901234567890 keep every digit (many formatters silently round them).

Why does it say my JSON is invalid?

The most common causes are a trailing comma after the last item, single quotes instead of double quotes, property names without quotes, and comments. The error message shows the line and column, and Show jumps straight to it.

How large a file can I format?

Files of several megabytes work well on a computer. Very large files (50 MB and above) may be slow, especially on phones, because everything is processed in your device’s memory.

Last updated

Missing a feature, or need a tool we don’t have? Suggest it.