Free JSON Formatter & Validator

Paste your JSON to format, validate, and pretty-print it. Minify or beautify with a single click.

JSON Input

Formatted Output

What is JSON?

JSON (JavaScript Object Notation) is a lightweight data-interchange format that's easy for humans to read and write, and easy for machines to parse and generate. It's the most common format for APIs, configuration files, and data storage.

Why Format JSON?

  • Readability — properly indented JSON is much easier to read and debug
  • Validation — catch syntax errors like missing commas, unmatched brackets, or trailing commas before they cause bugs
  • Minification — remove whitespace to reduce file size for storage or transmission
  • QR codes — minified JSON fits more data into a QR code
  • API debugging — format API responses to quickly understand the data structure

Common JSON Syntax Errors

  • Trailing commas after the last item in an array or object
  • Single quotes instead of double quotes for strings
  • Unquoted property names
  • Missing commas between items
  • Comments (JSON does not support comments)

Frequently Asked Questions

Why does my JSON fail to parse when it looks correct?

The usual culprits are things JavaScript allows and JSON does not. A trailing comma after the last item in an object or array is invalid JSON. So are single-quoted strings, unquoted keys, comments, and the values NaN and Infinity. A leading byte-order mark copied out of a text editor will also break parsing before the first character is read.

What is the difference between JSON and a JavaScript object?

JSON is a text format that borrows JavaScript's syntax; a JavaScript object is a value in memory. The practical consequences are the restrictions: JSON has no comments, no functions, no undefined, no dates and no trailing commas, and every key must be a double-quoted string. Anything that survives a round trip through text is JSON; anything that needs the language to exist is not.

Does formatting change what my JSON means?

No. Whitespace between tokens is insignificant, so beautifying and minifying produce documents that parse to exactly the same value. What can change is key order, if a tool sorts keys — the JSON specification says object key order is not meaningful, but plenty of real systems and diff tools rely on it, so preserve it unless you have a reason not to.

Should I minify JSON before putting it in a QR code?

Yes, if the payload is close to the capacity limit. Every space and newline is a byte, and pretty-printed JSON is routinely a third larger than the same data minified. Removing that whitespace can drop the QR code by several versions, which makes the printed symbol coarser and easier to scan. Our QR code capacity calculator shows exactly where the boundaries fall.

How should dates and large numbers be represented?

JSON has no date type, so dates travel as strings — ISO 8601 in UTC is the convention worth sticking to. Numbers are a subtler trap: the specification does not bound their size, but most parsers read them as IEEE 754 doubles, so an integer beyond about 9 quadrillion silently loses precision. Identifiers longer than that, including many database keys and snowflake IDs, should be sent as strings.

What does a 'circular structure' error mean?

It means something tried to serialise an object that refers back to itself, directly or through a chain of properties. JSON is a tree and cannot express a cycle. The fix is either to break the cycle before serialising or to replace the back-reference with an identifier that the other side can resolve.

Is JSON5, JSONC or NDJSON valid JSON?

No, and it matters when you hand a file to another system. JSON5 and JSONC add comments and relaxed syntax that a strict parser rejects. NDJSON, sometimes called JSON Lines, is a stream of separate JSON documents one per line, which is not itself a single valid document. All three are useful; none of them will parse where plain JSON is expected.

Is my JSON uploaded to a server?

No. The formatting and validation happen in your browser using the built-in JSON parser, with no network requests and no storage. That is deliberate: configuration files and API responses routinely contain keys, tokens and personal data, and none of it should be pasted into a service that sends it anywhere.

Scan QR Codes with JSON Data

The Scan & Generate app can read QR codes containing structured data like JSON, with instant parsing and copy support.