Remove all whitespace from valid JSON and show the size saved
JSON Formatter
Use JSON Formatter
What it does
Paste JSON, for example an RDAP or API response, and get it indented with 2 or 4 spaces, optionally with sorted keys. Invalid JSON shows the parser's error message and position.
It runs entirely in your browser: nothing you enter is uploaded.
Example
RDAP-style domain record
{"objectClassName":"domain","ldhName":"EXAMPLE.COM","status":["client delete prohibited","client transfer prohibited"],"events":[{"eventAction":"registration","eventDate":"1995-08-14T04:00:00Z"}]}{
"objectClassName": "domain",
"ldhName": "EXAMPLE.COM",
"status": [
"client delete prohibited",
"client transfer prohibited"
],
"events": [
{
"eventAction": "registration",
"eventDate": "1995-08-14T04:00:00Z"
}
]
}Prints the record with 2-space indentation, one key or array item per line; tick Sort keys to list events, ldhName, objectClassName and status alphabetically.
FAQ
What does the formatter check?
It parses the input with the browser's built-in JSON.parse, so anything that is not strict JSON is rejected with the parser's message and position. Valid input is printed with 2 or 4 spaces, with keys sorted at every level if you tick Sort keys, or on one line with Minify.
Can formatting change my data?
Values go through JavaScript, so integers above 2^53 such as 64-bit IDs are rounded (12345678901234567890 prints as 12345678901234567000), and with duplicate keys only the last one is kept. Comments, trailing commas and single quotes are reported as errors, not fixed.
Is the JSON uploaded?
No. Parsing and formatting run in your browser; nothing is sent or stored.