JSON Formatter

Skip to editor
Explorer
Open Files

No files open

0 files open

jsoneditor.io v2

No file open

Create a new file or open an existing one from the sidebar

JSONUTF-8
Spaces: 2

How do I format JSON online?

To format JSON online, paste it into the editor above and press Format, or use Shift+Alt+F (Shift+Option+F on a Mac). Every key lands on its own line with proper indentation, so a wall of minified text turns into something you can actually read.

The editor is Monaco, the same one inside VS Code, so you also get syntax highlighting, code folding, bracket matching and a red underline on anything that isn't valid JSON. Indentation follows the tab size in Settings, which is two spaces by default.

  1. Paste your JSON into the editor, or press Open to load a file.
  2. Press Format in the toolbar, or Shift+Alt+F.
  3. Copy the result, or press Save to download it.

Example

Minified JSON
{"id":7,"name":"Ada Lovelace","roles":["admin","editor"],"active":true,"lastLogin":null}
Formatted
{
  "id": 7,
  "name": "Ada Lovelace",
  "roles": [
    "admin",
    "editor"
  ],
  "active": true,
  "lastLogin": null
}

Questions people ask

What's the difference between formatting, beautifying and pretty printing JSON?

They're the same thing. All three mean adding indentation and line breaks so the structure is easy to follow, and the data itself doesn't change at all.

Why won't my JSON format?

Formatting needs valid JSON, so if it fails there's a syntax error somewhere. The status bar at the bottom shows the parser's error message, and the editor underlines the spot. Trailing commas, single quotes and unquoted keys are the usual suspects.

Can I change the indentation?

Yes, open Settings and change the tab size. Format uses it for the output.

Can I format JSON from the command line?

Sure, jq . file.json or python -m json.tool file.json will both pretty print it. The editor is handier when you want to read, fold and edit the result as well.

Is my data uploaded anywhere?

No, this runs entirely in your browser, so nothing you paste is sent to a server. The only feature that sends data anywhere is the optional AI assistant, and only when you actually ask it something.

Read the guideHow to Format JSON Online: A Complete Guide