JSON Formatter

Turn minified API responses and config files into readable, indented JSON — or squeeze formatted JSON into a single line. The formatter checks your JSON as you type, points to the exact line of any error, and never changes your data.

Indentation
Options

This tool runs entirely in your browser. Your files and text are processed on your own device and are never uploaded to our servers.

How to use the JSON Formatter

  1. Paste JSON into the input box or open a .json file. Use “Example” to try it.
  2. Choose the indentation — 2 spaces, 4 spaces or tabs — or Minify to remove all whitespace.
  3. Optionally sort keys alphabetically, which makes two JSON documents easier to compare.
  4. Copy or download the result. If the JSON is invalid, fix the error shown below the boxes and the output updates instantly.

Examples

Beautifying a minified API response

Input
{"id":1,"tags":["a","b"],"owner":{"name":"Ann"}}
Result
{
  "id": 1,
  "tags": [
    "a",
    "b"
  ],
  "owner": {
    "name": "Ann"
  }
}

Minifying for a smaller payload

Input
{
  "debug": false,
  "retries": 3
}
Result
{"debug":false,"retries":3}

Your data is never changed

Many online formatters run JSON through the browser’s JSON.parse, which silently rounds large numbers — 12345678901234567890 becomes 12345678901234567000 — and rewrites values such as 1.50 as 1.5. Toolora uses its own strict parser that keeps every number and string exactly as written, changing only the whitespace (and key order, if you choose to sort).

Frequently asked questions

Is my JSON sent to a server?

No. Formatting happens in your browser, so API keys, tokens and personal data in your JSON stay on your device.

Should I use 2 spaces, 4 spaces or tabs?

It’s a matter of convention: 2 spaces is the most common for JSON in web projects, 4 spaces matches many Python and Java code styles, and tabs let each reader choose their own width.

Does sorting keys change my data?

No. Object key order has no meaning in JSON, so sorting only changes how it looks. Array order is never changed.

Can it fix invalid JSON automatically?

It doesn’t guess, because a wrong guess could change your data. Instead it shows exactly where the problem is with a hint — for example a trailing comma or single quotes — so you can fix it in seconds.

Everything you need. One simple place.

Free, fast online tools for text, PDFs, images, data and everyday maths. Every tool runs entirely in your browser, so your files stay on your device.

  • Privacy-first processing
  • No sign-up required

© 2026 Toolora. All rights reserved.

Built for speed and privacy