JSON Formatter

Format raw JSON into readable, indented output or compress it to a single line. Invalid JSON is reported with the exact line and column of the problem, so mistakes are easy to find. Everything runs in your browser.

Privacy: this tool processes your data entirely in your browser. Nothing you paste or type is sent to the server.

Paste or type the JSON document to format.

Result

Enter your values and press Calculate — the result appears here.

Worked examples

Pretty-print a small object

  • json = {"name":"Ada","age":36,"active":true}
  • action = format
  • indent = 2

Result: { "name": "Ada", "age": 36, "active": true }

Minify a formatted document

  • json = {"a": [1, 2, 3]}
  • action = minify
  • indent = 2

Result: {"a":[1,2,3]}

Find the error in broken JSON

  • json = {"name": "Ada",, "age": 36}
  • action = format
  • indent = 2

Result: Invalid JSON at line 1, column 19 — the second comma is unexpected.

Frequently asked questions

Is my JSON sent to a server?

No. This tool formats everything locally in your browser. Nothing you paste is transmitted anywhere.

What does the line/column error mean?

When JSON is invalid, the parser reports the exact position where it stopped understanding the input. "Line 1, column 19" points at the character to fix, which is usually right after a missing or extra comma, brace, or quote.

Why does my JSON keep failing to parse?

The most common causes are trailing commas, single quotes instead of double quotes, unquoted keys, and comments. JSON is strict: keys and strings must use double quotes and there must be no trailing commas.

💬 Discuss on BestWordz Community

Join the conversation about Developer, json formatter, pretty print json on the BestWordz Community forum.

Visit Forum →
Copied!