JSON Formatter

Format and beautify JSON online

Paste messy or minified JSON and turn it into clean, indented, readable JSON in one click. Everything runs in your browser, so private data stays on your device.

Open the JSON formatter → Free · No sign-up · Runs in your browser

How to use it

  1. Open the editor and paste your JSON, open a .json file, or load it from a URL.
  2. Click Format. The JSON is re-indented with 2 or 4 spaces (change it in Settings).
  3. Copy the result or download it as a .json file. Click Minify to get a single line again.

Example

Input (minified)
{"id":42,"name":"Ada Lovelace","roles":["admin","editor"],"address":{"city":"London"}}
Output (formatted)
{
  "id": 42,
  "name": "Ada Lovelace",
  "roles": [
    "admin",
    "editor"
  ],
  "address": {
    "city": "London"
  }
}

Features

Format and minify

Pretty-print with consistent indentation, or compress to one line for payloads and config files.

Sort keys

Optionally sort object keys alphabetically so two documents are easier to compare.

Live validation

Syntax errors are reported as you type, with the error message shown under the editor.

Multiple tabs

Work on several documents at once. Tabs are saved in your browser between visits.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Formatting, validation and every other tool run locally in your browser. Your JSON is never sent to our servers.

Can I choose the indentation?

Yes. Open Settings and pick 2 or 4 spaces. You can also turn on alphabetical key sorting.

How do I minify JSON?

Click Minify in the editor toolbar. It removes all whitespace while keeping the data identical.

Does it work with large files?

Yes. Files over 10 MB are opened with a streaming parser and syntax highlighting is switched off to keep the editor responsive.