JSON Formatter
Format and validate JSON data.
About JSON Formatter
Beautify messy JSON into readable, indented text, or compact it down to a single line - all instantly, in your browser.
- Paste or type your JSON into the editor.
- Click Format to beautify it with readable indentation.
- Click Minify to compact it to a single line.
- Click Import to load JSON from a file or a URL.
- Click Share to create a read-only link others can open - no login needed, and it expires automatically after 90 days.
- Click the clipboard icon to copy the result.
- Format instantly reveals syntax errors - the message tells you exactly what's wrong and where.
- Minify before pasting JSON into a request body, URL parameter, or environment variable to save space.
- Everything happens locally - nothing is sent anywhere unless you explicitly click Share.
- Use Share to send a snippet to a teammate instead of emailing a file back and forth - see our guide to sharing JSON for details on privacy and limits.
Format, Beautify and Validate JSON Online
Paste JSON in any shape - minified, badly indented or straight from a log - and get clean, consistently indented output. The same editor validates as you type, minifies and sorts keys.
What each action does
- Format: re-indents the JSON with one item per line, using the indentation from your editor settings.
- Minify: removes all whitespace and line breaks, leaving a single compact line.
- Sort: orders object keys alphabetically at every level; the order of array items is kept.
- Validation: runs as you type. Invalid JSON is flagged with the parser's message and the position of the problem.
Common reasons to format JSON
- Reading a minified API response or log line
- Tidying JSON before committing it or sending it for review
- Finding the missing comma or bracket in invalid JSON
- Sorting keys so two documents are easier to compare
JSON Formatter FAQ
Does formatting change my data?
Only the whitespace. Two caveats, because the JSON is parsed and written back: integers beyond JavaScript's safe range (about 16 digits) can lose precision, and if a key is repeated in one object only its last value is kept.
How do I change the indentation?
Open Settings and choose the indent style you want. Format uses it from then on.
What is the difference between a JSON formatter and a JSON validator?
A validator tells you whether JSON is syntactically correct; a formatter rewrites valid JSON so it is easy to read. This page does both. For checks beyond syntax, such as duplicate keys or schema rules, use the JSON Inspector or the JSON Schema Validator.
Is my data uploaded to a server?
No. Formatting happens in your browser. JSON is only stored online if you click Share to create a link.