TOOL · DEV
Format and minify JSON
Paste the messy JSON and take it back indented the way you like — or minified for production. Syntax error? The tool points at the approximate line.
Everything runs in your browser — your JSON is never sent anywhere.
Processed in your browser — your files never leave your computer.
How it works
-
Paste the JSON
Into the input box. Very large file? Above ~5 MB the tool warns it may choke for a few seconds, but it works.
-
Pick the indentation and click
2 spaces, 4 spaces or tab in the selector, then "Format" — or "Minify" to strip every space and line break. The mono proof shows the size before → after.
-
Copy or download
"copy result" to the clipboard or "download .json" to save as a file. If the JSON has an error, the message points at the approximate line and what to check.
Frequently asked questions
Does the error show exactly where the problem is?
It shows the approximate line — computed from the position the JavaScript engine reports — plus the engine’s original message. The usual suspects: a trailing comma after the last item, single quotes instead of double quotes, and an unclosed brace or bracket.
Which indentation should I pick: 2, 4 or tab?
A matter of project convention. 2 spaces is the most common in the JavaScript/web world; 4 is frequent in Python and .NET; tab pleases those who adjust the width in their editor. For the JSON itself it makes no difference — it is presentation only.
What is the difference between formatting and minifying?
Formatting adds line breaks and indentation so you can read it; minifying removes all of that to shrink the size — useful for API responses and production files. The content is identical either way, data byte for data byte.
My JSON has comments and the tool flags an error — why?
Because pure JSON does not allow comments — that is the format, not the tool. Comments belong to JSONC (used by VS Code) and YAML. Remove the lines with // or /* */ and the parse passes.
Is there a size limit?
No hard limit — but above ~5 MB the tool warns that formatting may take a few seconds, since parsing runs on the page thread. For giant log files, splitting first is worth it.
Is my JSON sent to any server?
No. Parsing and formatting run with your browser’s native JSON.parse, on your machine. API payloads, configs with secrets — nothing leaves here.