JSON Formatter
Minified JSON from an API response or a config file is unreadable as one long line, and a single missing comma or unmatched bracket is often invisible until something actually tries to parse it and fails. This formatter pretty-prints with proper indentation and syntax highlighting, and, more usefully, tells you exactly where a validation error is, rather than just saying "invalid JSON."
How to use the JSON Formatter
- Paste or type your JSON into the input area.
- Select your preferred indentation size (2 spaces, 4 spaces, or tab).
- Click "Format" to prettify or "Minify" to compact the JSON into a single line.
- Review the formatted output and any validation errors that appear.
- Click the copy button to copy the result to your clipboard.
Where JSON errors most often hide
Trailing commas after the last item in an array or object are valid in JavaScript object literals but invalid in strict JSON. This is the single most common "my JSON won't parse" bug for people coming from JS. Unquoted keys are another JS-vs-JSON mismatch: {name: "value"} is valid JS, but invalid JSON, since keys must be double-quoted strings. And a single stray backslash in a string (especially copy-pasted from a Windows file path) can silently break parsing several lines later than where the actual mistake is.
Frequently asked questions
What's the difference between "prettify" and "minify"?
Prettify adds indentation and line breaks for human readability; minify strips all unnecessary whitespace to reduce file size, which is useful before shipping JSON to production where every byte in a network response matters.
Does it validate strict JSON or JavaScript object syntax?
Strict JSON only. Trailing commas, unquoted keys, and single-quoted strings (all valid in JS) will be flagged as errors here, since they aren't valid JSON.
Can it handle very large JSON files?
It's built for typical API responses and config files; extremely large files (multi-megabyte) may be slow to render with full syntax highlighting in the browser.
Related Tools
JWT Decoder
Decode and inspect JSON Web Tokens — view header, payload, and expiration without a server.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text, with full Unicode support.
Regex Tester
Test regular expressions with live highlighting, match details, and a quick reference cheat sheet.
Text Diff Checker
Compare two blocks of text side by side and see exactly what changed — additions, deletions, and modifications.