Developer Tools
JSON Formatter
Format, validate, and minify JSON with line and character counts.
Lines1
Characters17
Valid JSON
About the JSON formatter
Paste minified JSON and get a pretty-printed version with 2 or 4-space indentation, sorted keys, and clear error messages when the input isn't valid. Or paste pretty JSON to minify it for an API request.
Frequently asked questions
Can it format JSON with comments?
Standard JSON forbids comments, but the tool tolerates // and /* */ in the input - they're stripped on format. The output is strict JSON.
Will it sort my keys alphabetically?
Toggle 'sort keys' in the options. Useful for diffing JSON files where key order isn't meaningful.