Skip to content

JSON Formatter

Format, validate and minify JSON, with the exact line and column of any error.

Output

Result

Paste JSON above and select Format JSON to validate and format it.

Runs in your browser — nothing you enter is sent to a server.

How the JSON Formatter works

Paste JSON, choose Formatted or Minified, and select the button. If the JSON is valid you get the result with a copy button and a download. If it isn't, you get the reason and the exact line and column of the first error.

Validation uses your browser's own JSON parser, so anything accepted here is valid JSON everywhere. Your data never leaves your device — useful for API responses and config files that contain private values.

Examples

Formatting

{"id":7,"tags":["a","b"]}
→
{
  "id": 7,
  "tags": [
    "a",
    "b"
  ]
}

A common error

{"id": 7, "name": "x",}

Trailing commas aren't allowed in JSON — the tool points to line 1, column 23.

Frequently asked questions

Why is my JSON invalid when it works in JavaScript?

JSON is stricter than JavaScript: keys and strings need double quotes, trailing commas aren't allowed, and comments, undefined, NaN and functions aren't valid values.

What does “Sort keys A–Z” do?

It orders object keys alphabetically at every level, which makes two JSON documents easier to compare. Array order is never changed, because it can carry meaning.

Is there a size limit?

Only your device's memory. Files of several megabytes format in a moment; very large files can take longer on older phones.

Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 to text, with full Unicode support and URL-safe output.

Developer Tools