Format, validate and minify JSON instantly — paste any JSON to get it beautifully indented, validated for errors, minified for production or converted to a readable structure.
Enter your figures and click Calculate to see your results.
Paste your JSON into the text area, choose whether to format, minify or validate only, then select your preferred indent size.
Click the Format button. Your code is processed instantly — all formatting runs in your browser with no data sent to servers.
The formatted output appears on the right. Click Copy to grab it, or Download to save as a file. Statistics like size reduction and line count are shown automatically.
JSON (JavaScript Object Notation) is a lightweight data interchange format used by virtually every modern API. Minified JSON removes all whitespace to reduce file size, making it unreadable to humans. Formatting (pretty-printing) adds indentation and line breaks, making the structure immediately clear. Developers format JSON constantly when debugging APIs and inspecting data.
Common JSON errors: trailing commas after the last item in an object or array (not allowed in JSON, though allowed in JavaScript), using single quotes instead of double quotes for strings, unquoted property keys, undefined or NaN values (not valid JSON — use null instead), comments (JSON has no comment syntax), and missing commas between items. This validator shows the exact line and position of any error.
JSON5 is a superset of JSON that allows JavaScript-like syntax: trailing commas, single-quoted strings, comments (// and /* */), unquoted keys, hexadecimal numbers and multi-line strings. JSON5 is useful for config files where human editing is common. Standard JSON parsers reject JSON5 syntax — always use standard JSON for API responses and data exchange.
JSON Schema is a vocabulary for validating the structure of JSON data. It defines expected types, required fields, value constraints and nested structure. For example, you can specify that a "price" field must be a number greater than 0, or that an "email" field must match a specific regex pattern. JSON Schema is widely used in API documentation (OpenAPI/Swagger uses it extensively).
JSON is more compact, easier to read, natively supported in JavaScript and faster to parse. XML supports attributes, mixed content (text + elements), comments, namespaces and document type definitions — making it more expressive for documents. JSON dominates modern REST APIs; XML is still used in SOAP services, RSS feeds, SVG, configuration files (Maven, Android) and document formats.
JSONP (JSON with Padding) was a technique used before CORS existed to make cross-origin requests. The server wraps the JSON in a function call: callback({"data":"value"}). The browser executes this as a script, calling the named function. JSONP is now obsolete — modern APIs use CORS headers. Never use JSONP with untrusted APIs as it has security risks (XSS).
JSON Lines (JSONL or NDJSON) is a format where each line is a valid JSON object, separated by newlines. Unlike standard JSON arrays, JSONL files can be processed line by line without loading the entire file into memory — essential for large datasets. It is widely used in machine learning training data, log aggregation and streaming data pipelines.
There is no technical size limit defined by the JSON specification. Practical limits come from: available RAM when parsing, browser/runtime memory limits (Node.js default is ~1.5GB), and network timeouts. Large JSON files (>10MB) should use streaming parsers (like JSONStream in Node.js) rather than JSON.parse, which loads the entire file into memory at once.