JSON Formatter rfc 8259
Format JSON with indentation, minify it to a single line, and locate syntax errors.
What this tool does
JSON is the most widely used data format for API responses and configuration files. It is readable by design, but the JSON actually sent over the wire is usually minified to a single line to save bandwidth, which makes the structure hard to follow.
Beautify inserts line breaks and indentation that match the nesting level so the shape of the data becomes visible. Minify does the opposite, stripping every unnecessary space to reduce payload size. Both directions parse the input first, so a successful conversion is itself a confirmation that the document is syntactically valid.
When parsing fails, the position of the error is reported. The most common mistakes are a trailing comma after the last element, keys that are not wrapped in double quotes, single quotes used for strings, and unescaped double quotes inside a string. All of these are legal in JavaScript object literals but invalid under the JSON standard, RFC 8259.
When to use it
Use it when an API response arrives on a single line, when validating a configuration file before deploying it, when hunting for one field inside a JSON string in a log, when preparing a readable sample to share with a colleague, or when minifying a request body.
Input and output examples
{"name":"alice","roles":["admin","dev"],"active":true}
{
"name": "alice",
"roles": [
"admin",
"dev"
],
"active": true
}
Beautify direction: nesting becomes visible at a glance.
{"name":"alice",}
Syntax error: trailing comma with no following value
Allowed in JavaScript, invalid in JSON.
Notes and limitations
Standard JSON does not allow comments, so configuration files written in JSON5 or JSONC will be reported as invalid. Very large integers can lose precision because of JavaScript number limits, so compare ID values against the source when accuracy matters. Key order carries no meaning in the standard and may be preserved or reordered depending on the implementation.
Frequently asked questions
Can I put comments in JSON?
Not in standard JSON. Use JSON5 or YAML if comments are essential, or adopt a convention such as a _comment key.
Why are single quotes invalid?
The JSON standard requires double quotes for both keys and string values. Single quotes are only valid in JavaScript object literals.
Large ID numbers change value.
JavaScript numbers have a safe integer limit, and values beyond it lose precision. Large identifiers are safer as strings.