JSON Formatter

Pretty-print compact or broken JSON with a readable indentation.

Runs in your browser Developer Tools Free · No account

Input

Processed locally

This tool runs entirely in your browser. The data you paste or load is never uploaded.

Result

Enter your input, then run the tool.

About this tool

Paste JSON and get a clean, indented document that is easy to read and review. The formatter validates the input first, reports the exact position of a syntax error, and can sort object keys alphabetically for stable diffs.

How to use it

  1. Paste JSON into the input panel, or press “Load example”.
  2. Choose the indentation and whether keys should be sorted.
  3. Press Format JSON, then copy or download the result.

Example

Input

{"site":"Tooldeck","nested":{"ok":true},"items":[1,2,3]}

Output

{
  "items": [
    1,
    2,
    3
  ],
  "nested": {
    "ok": true
  },
  "site": "Tooldeck"
}

Frequently asked questions

Why does my JSON fail to parse?
Trailing commas, single quotes and unquoted keys are JavaScript, not JSON. The error message names the line and column of the first problem so you can fix it quickly.
Does formatting change my data?
No. Values, numbers and key order are preserved unless you enable key sorting. Only whitespace is rewritten.

Keep going

More in this category