Use the JSON Formatter in three steps
Paste JSON
Add an object, array, or JSON value to the editor.
Format or minify
Choose a readable or compact representation.
Copy the result
Use the cleaned JSON in your project or request.
Formatting also validates
The formatter must parse the input before rebuilding it. A parsing message identifies invalid syntax such as missing quotes, commas, or brackets.
JSON is stricter than JavaScript
Property names and string values require double quotes. Comments, trailing commas, and undefined values are not valid standard JSON.
JSON Formatter FAQ
Will formatting change JSON values?+
No. Valid values are preserved; formatting only changes whitespace and indentation.
Is pasted JSON uploaded?+
No. Parsing and formatting happen in your browser.
Can the formatter handle JSON arrays?+
Yes. Objects, arrays, strings, numbers, booleans, and null are all valid JSON values.
Why are comments rejected?+
Standard JSON does not support comments. Remove JavaScript-style comments before formatting or use a JSON5-specific tool.
Are trailing commas valid JSON?+
No. A comma after the final property or array item causes a parsing error in standard JSON.
What does Minify change?+
Minify removes unnecessary spaces and line breaks. It does not rename keys or change parsed values.