JSON Formatter & Validator
Validate, format, or compact JSON while keeping large numbers, key order, and original string escapes intact.
Up to 200,000 characters. Processed locally in your browser. Escape then Tab moves out of the editor.
{
"id": 900719925474099312345,
"name": "MRHTML",
"settings": {
"theme": "dark",
"alerts": true
},
"roles": [
"editor",
"reviewer"
]
}
Example output is ready. Paste your code to begin.
JSON formatting that preserves your data
The JSON formatter reads the original tokens instead of converting numbers
into JavaScript’s floating-point number type. Large IDs such as 900719925474099312345, exponent notation, negative zero,
string escapes, and object key order remain intact. Pretty mode changes
only whitespace outside strings; compact mode removes that whitespace.
How to format or compact JSON
- Paste a JSON object, array, or primitive value.
- Choose readable or compact output and an indentation style.
- Select Format JSON. Invalid input shows an error instead of an incomplete result.
-
Copy the validated output or download a
.jsonfile.
Duplicate keys and strict syntax
Duplicate keys in the same object are rejected visibly, including
differently escaped spellings of the same key. This avoids silently
dropping data. The same key in separate objects is allowed. Comments,
trailing commas, unquoted keys, NaN, and Infinity are not valid JSON and are rejected.
Limits
Input is limited to 200,000 characters and 100 nesting levels. Output is capped at two million characters. Processing takes place in a cancellable worker with a ten-second limit. The formatter checks JSON syntax, not conformance to a JSON Schema, and never sends pasted data to a server.