JSON Formatter and Validator
Paste JSON to format it. Errors show the exact line and column.
Valid JSON (object, 5 keys), 197 characters
{
"name": "Tidy Dev Tools",
"tools": [
"json-formatter",
"base64-encode",
"cron"
],
"free": true,
"version": 1.2,
"owner": {
"name": "GamePro",
"country": "PL"
}
}
Updates as you type. Ctrl+Enter (⌘+Enter on Mac) in the input processes immediately and jumps to the first error.
How it works
Paste JSON into the input (on a phone: the Input tab). It is checked as you type, and valid JSON appears formatted in the output, ready to copy. If something is wrong, the status line above the editor names the problem with its line and column, and the offending character is highlighted in the input. Press Ctrl+Enter to jump straight to it.
Pretty indents nested objects and arrays with two spaces, one value per line. Minify removes every optional space and line break, which is what you want for environment variables, query parameters and compact HTTP payloads. Your choice is remembered on this device.
Everything runs in your browser. Nothing is uploaded, so it is safe to format API responses that contain tokens, e-mail addresses or other personal data.
The most common JSON errors
- Trailing comma —
{"a": 1,}. JavaScript allows it, JSON does not. - Single quotes —
{'a': 1}. JSON strings and keys need double quotes. - Unquoted keys —
{a: 1}is a JavaScript object literal, not JSON. - Comments —
// …is not allowed. Use JSON5 or strip comments first. - Raw line breaks inside strings — write
instead of pressing Enter between quotes. - Big integers — numbers above 253 lose precision in JavaScript. Send IDs as strings.
JSON, JSON5, JSONC and NDJSON
Strict JSON (RFC 8259) is what APIs exchange and what this validator checks. JSON5 and JSONC, used by editors and some configuration files, relax the rules with comments, trailing commas and single quotes. NDJSON, common in logs and data exports, puts one complete JSON document on each line; validate such files line by line rather than as a whole. Strict mode here means any relaxed syntax is flagged immediately, before a stricter production parser rejects it.
Questions
Does formatting change my data?
No values change. Whitespace between tokens is rewritten, and duplicate keys collapse to the last occurrence, exactly as JSON.parse in every browser behaves.
How large a file can it handle?
Several megabytes work smoothly on a laptop. For files over roughly 50 MB, a command-line tool such as jq . is faster and uses less memory.
Why is my output tab empty on a phone?
The output updates only while the input is valid. Switch to the Input tab, fix the highlighted character, and the formatted version returns automatically.
Can I sort keys alphabetically?
Not yet. Key order is preserved as written, which keeps diffs against the original small.