JSON Formatter & Validator

Instantly format, pretty-print, and validate JSON. Detects syntax errors with position info, and shows key count, max depth, and byte size.

Enter your details
Result
Enter your details on the left, then press Calculate.

Related calculators

Frequently asked questions

What is JSON?

JSON (JavaScript Object Notation) is a lightweight text format for storing and transmitting structured data. It supports 6 data types: strings (double-quoted), numbers, booleans (true/false), null, arrays (ordered lists in []), and objects (key-value pairs in {}). It is the de facto standard for REST API responses and configuration files.

What are common JSON syntax errors?

The most frequent mistakes: (1) Trailing commas after the last item in an object or array — valid in JavaScript but banned in JSON. (2) Single quotes around strings — JSON requires double quotes. (3) Unquoted property keys — {"name": "John"} is correct. (4) Missing comma between properties. (5) Comments — JSON has no comment syntax. (6) NaN and Infinity — not valid JSON values.

What is the difference between JSON and XML?

Both are human-readable data interchange formats. JSON is more concise, natively maps to JavaScript/Python data structures, and is used in virtually all modern APIs. XML is more verbose but supports schemas (XSD), namespaces, mixed content, attributes, and XSLT — still common in enterprise systems, SOAP APIs, and document formats like Word (.docx) and SVG.