How to Format and Validate JSON
You copied a blob of JSON out of an API response or a log file, and it's an unreadable single line — or worse, it won't parse and you can't tell why. You just want it cleaned up and checked, right now, without pasting sensitive data into some random site.
This guide walks you through Tooldrop's free JSON formatter. Paste your JSON, beautify or minify it, and let the tool validate it with plain-English error messages. There's no sign-up, no size limits, and because it runs entirely in your browser, your JSON is never uploaded to a server.
Step by step
- 1Open the JSON Formatter at /dev/json-formatter. Nothing to install or sign up for — the page is ready the moment it loads.
- 2Paste your JSON into the large "JSON to format" input box, or type it in directly. It accepts anything from a one-line object to a deeply nested API response.
- 3Click Beautify to pretty-print it with clean two-space indentation and line breaks, making the structure easy to read. The formatted result appears in the Output panel below.
- 4Prefer a compact version? Click Minify instead to strip out every bit of insignificant whitespace, producing the smallest possible single-line JSON — handy for embedding in code or sending over the wire.
- 5If your JSON has a problem, a red error message appears explaining what went wrong (for example, an unexpected character or a missing comma) so you can fix it and try again. A clean result means your JSON is valid.
- 6Click Copy under the Output panel to put the result on your clipboard, then paste it wherever you need it.
- 7Click Clear to wipe the input and output and start fresh with a new snippet.
When and why to format and validate JSON
Beautifying JSON is about making it readable. API responses, config files, and log entries often arrive minified or jammed onto a single line, which is miserable to scan for the one value you care about. Pretty-printing adds indentation and line breaks so the structure becomes obvious at a glance.
Minifying does the opposite, and it's useful too. When you're pasting JSON into source code, storing it compactly, or trimming the payload size of a request, removing whitespace keeps things tidy.
Validating is the quiet hero. The formatter parses your JSON before it can format it, so if anything is malformed — a trailing comma, a missing quote, a stray bracket — it tells you instead of silently producing garbage. That turns ten minutes of squinting at a wall of text into a quick fix.
Tips for the best results
Paste the entire JSON document, not a fragment. A single object or array property pulled out of context usually won't parse on its own, and the error you get back will be about the missing surrounding braces rather than the real issue.
Watch for the usual culprits when validation fails: trailing commas after the last item, single quotes instead of double quotes, unquoted keys, and comments (standard JSON doesn't allow them). The error message points you toward the spot to check.
If you're cleaning up data to commit or share, Beautify first so reviewers can read it. If you're optimizing for size or pasting into a string literal, Minify last. You can switch between the two as many times as you like — there are no limits.
Is it safe and private?
Yes. This is one of the main reasons to use it. The JSON formatter does all of its work directly in your browser using your device's own JavaScript engine. Your JSON is never sent to a server, never uploaded, and never stored anywhere.
That matters because JSON often carries real data — access tokens, customer records, internal IDs, API keys. With a tool that processes on-device, that data never leaves your machine, so there's nothing to leak and nothing to log. You can confirm this yourself: format something, then disconnect from the internet and watch it keep working.
There's also no account and no sign-up, so you're not handing over an email address or agreeing to terms just to tidy up a config file.
Common problems and how to fix them
"Unexpected token" or "Unexpected character": something in the text isn't valid JSON at that position — often a smart/curly quote pasted from a document, a single quote, or an unquoted key. Replace fancy quotes with straight double quotes.
"Unexpected end of JSON input": the document is cut off or a bracket/brace isn't closed. Check that every { and [ has a matching } and ].
Nothing happens when you click Beautify or Minify: the input box is empty, so the buttons stay disabled. Paste your JSON first.
The result looks right but you expected comments or trailing commas to survive: those aren't part of the JSON standard, so a strict parser drops or rejects them. If your source uses JSON5-style syntax, remove the comments and trailing commas before formatting.
Frequently asked questions
Is this JSON formatter really free?
Is my JSON uploaded anywhere?
What's the difference between Beautify and Minify?
How does it tell me my JSON is invalid?
Tools used in this guide
Related guides
Paste any JSON Web Token to read its header and payload in seconds — free, private, and entirely in your browser.
Paste a JSON array of objects and get clean, spreadsheet-ready CSV in seconds — free, private, and entirely in your browser.
A step-by-step guide to testing regular expressions with Tooldrop's free, browser-based Regex Tester, with live matches and capture groups.