Format, validate, minify, and repair JSON instantly. Live validation as you type, syntax highlighting, sort keys, file upload, and auto-fix for trailing commas, single quotes & unquoted keys. 100% free.
JSON (JavaScript Object Notation) is a lightweight, text-based data format used to exchange information between applications. It represents data as key-value pairs (objects) and ordered lists (arrays), and supports strings, numbers, booleans, null, objects, and arrays as value types. Despite its name, JSON is completely language-independent and is supported by virtually every programming language.
JSON is the dominant format for web APIs, configuration files, database documents (MongoDB, Firestore), and data serialization. If you work in web development, you encounter JSON every day.
Raw JSON from an API or a log file is often delivered as a single compressed line — impossible to read at a glance. Formatting (or "pretty-printing") adds indentation and newlines so you can see the structure clearly: which keys belong to which object, how deep an array is nested, and where a value is located. This tool formats JSON with 2-space, 4-space, or tab indentation.
{"a": 1, "b": 2,} — the comma after the last item is invalid JSON. The Repair button removes these automatically.
{'key': 'value'} — JSON requires double quotes. Single quotes are valid JavaScript but not valid JSON. Repair converts them.
{key: "value"} — keys must be quoted strings in JSON. This is valid JavaScript object syntax but not JSON. Repair adds the missing quotes.
// comment and /* block */ comments are not part of the JSON spec. Repair strips them before parsing.
undefined, NaN, and Infinity are not valid JSON. Replace them with null or a numeric alternative.
settings.json, tsconfig.json, etc. Adds // and /* */ comments. Not parseable by standard JSON parsers.
Use a try/catch around JSON.parse(): if it throws, the JSON is invalid. The error object includes a message with position information in most browsers. This tool uses the same approach to give you line and column numbers when validation fails.
There is no theoretical limit in the JSON specification. In practice, browser-based tools (like this one) are limited by available JavaScript heap memory. For files larger than a few MB, use a server-side parser (PHP's json_decode(), Python's json.loads(), or Node.js's JSON.parse()) which handles larger inputs more efficiently.
No. JSON has no native date type. Dates are typically represented as ISO 8601 strings (e.g. "2025-01-15T09:30:00Z") or as Unix timestamps (integers). When parsing, your application code must convert these strings to Date objects.
For most modern use cases, yes. JSON is more compact, faster to parse, and maps naturally to data structures in JavaScript, Python, and most other languages. XML has advantages for document-centric data (mixed content, namespaces, attributes vs. elements) and is still common in SOAP APIs and some enterprise systems. For REST APIs and configuration, JSON is the clear standard today.