Skip to content

JSON formatter & validator

Paste JSON to beautify, validate or minify it. Errors point to the exact line and column. Everything stays in your browser.

input.json
Formatted JSON appears here.
Ctrl/⌘ + Enter formats ·

Strict JSON in one minute

  • Keys and strings use double quotes: {"name": "Ada"}.
  • Values are strings, numbers, true, false, null, objects or arrays. No undefined, NaN, dates or functions.
  • No trailing commas and no comments.
  • Escape " and \ inside strings, and write newlines as \n.

In code: Python’s json.dumps(data, indent=2) and JavaScript’s JSON.stringify(data, null, 2) produce the same pretty format. Try both in the Python compiler or the JS playground.

Frequently asked questions

Is my JSON uploaded to a server?

No. Formatting, validation and minifying all run in your browser with the built-in JSON parser. You can use it on API responses and config files that contain private data.

What does “Fix common mistakes” change?

It removes // and /* */ comments and trailing commas, converts single-quoted strings to double quotes and quotes bare object keys. These are the usual differences between JavaScript object literals (or JSON5) and strict JSON.

Why is my JSON invalid?

The most common causes are trailing commas, single quotes, unquoted keys, comments, and unescaped control characters or quotes inside strings. The validator points to the line and column where parsing failed.

Does sorting keys change the data?

No. JSON objects are unordered by definition (RFC 8259), so sorting keys only changes presentation. It is handy for diffing two responses. Array order is never changed.