Check and format JSON
Paste JSON or open a UTF-8 file, then choose syntax checking, formatting, or minification. Check syntax errors by line and column; formatting and minification preserve number notation, string escapes, and key order. Copy the entire result or save it as result.json.
What you can do
Locate syntax errors
When the input cannot be read as JSON, the error's line and column are displayed. Correct the input and check it again.
Choose between formatting and minifying
Format for readability using 2 or 4 spaces, or tabs. You can also create compact JSON by removing whitespace outside strings.
Preserve the representation of original values
Number representations, string escapes, and key order are preserved. You can compare the original input and processed results side by side.
How to use
Enter JSON
Paste JSON, or use “Open JSON file” to load a UTF-8 file. You can also try “Use sample.”
Choose an action and run it
Choose syntax checking, formatting or minifying. For formatting, choose the indentation, then press the action button.
Check and retrieve the result
If there is an error, correct the area around the indicated line and column and run again. If the syntax is valid, you can copy the result or save it as result.json.
Useful when
Make single-line JSON easier to read
When you want to add line breaks and indentation to check the fields and nesting of received data.
Find JSON syntax errors
When you want to inspect data that cannot be read because of quote or comma errors, starting from the indicated location.
Reduce extra whitespace
When you want to transfer JSON with its values preserved while removing whitespace and line breaks outside strings.
The basics of checking JSON
Name-value pairs and arrays
JSON represents data as name-value pairs or ordered arrays. Besides objects and arrays, input consisting only of a string, number, true, false, or null is also supported.
Quotes, commas, and comments
Enclose keys and strings in double quotes. Extra trailing commas, single quotes, and comments are not allowed in standard JSON syntax. They are not automatically removed or repaired.
The difference between checking, formatting, and minifying
Syntax checking returns the input unchanged. Formatting adjusts whitespace and line breaks for readability, while minifying removes whitespace outside strings. It does not shorten the contents of strings.
Keys with the same name and large numbers
Duplicate keys and large number representations are preserved. However, the receiving software may overwrite or round values. When duplicate keys are present, a count and a caution are displayed.
Valid syntax and correct content
Syntax checking checks how JSON is written. It does not guarantee that all required fields are present, that amounts or dates are correct, or that the data meets the recipient's specifications.
Frequently asked questions
Can I use JSON containing comments or trailing commas?
Input is treated as standard JSON, so comments and trailing commas cause errors. This is not a feature that automatically repairs JSON5 or JSONC input.
Will numbers or key order change?
Number representations, string escapes, and key order are preserved. Values such as 9007199254740993, 1e400, and -0 are not rewritten into different number representations.
If the syntax is valid, is the data content also correct?
No. Missing fields, the correctness of values for business use, and compliance with JSON Schema are not validated. Check against the receiving system's specifications.
Will my input disappear if an error occurs?
The input is kept and an error is displayed. Correct the area around the indicated line and column, then run again. Changing the input or settings clears the previous results.
Can I also save JSON minified to a single line?
Yes. You can copy the full results of formatting, minifying, or syntax checking, and save them as result.json.
Input and results
- Input
- Pasted input is limited to 1,000,000 UTF-16 code units. Files must be UTF-8 and no larger than 1 MB (1,000,000 bytes). The filename indicates the source file, and edited input can also be processed.
- Processing
- Up to 10,000 values and a depth of 64. The root has depth 0. Processing stops if it takes more than 5 seconds, with guidance to reduce the data and run again.
- Results
- Output is limited to 2,000,000 UTF-16 code units. Copying and JSON saving include the full output. Formatting and minifying change only whitespace outside strings.