Shrink your JSON payload in one click
Paste your JSON above and hit Minify. Every unnecessary space, tab, and newline gets stripped out instantly, leaving you with a compact string that's faster to send over a network and cheaper to store - with zero changes to your actual data or key order.
Your JSON never leaves your browser. Nothing is uploaded to any server, so credentials, API responses, and private config files stay completely private.
How to use this JSON minifier
- Paste your JSON into the editor above.
- Click the Minify button (or choose the Minify option if you see multiple modes).
- Copy the compact output with the one-click copy button.
- Paste it straight into your app, request body, config file, or wherever it's needed.
Before & after: how much smaller does it get?
Input (formatted, 195 characters):
{
"user": {
"id": 42,
"name": "Ada Lovelace",
"active": true,
"roles": ["editor", "admin"]
}
}Output (minified, 71 characters):
{"user":{"id":42,"name":"Ada Lovelace","active":true,"roles":["editor","admin"]}}That's a 64% reduction in size - purely from removing whitespace. The keys, values, and order are identical. Only whitespace is stripped; the data is untouched.
How to minify JSON in code
If you need to do this programmatically rather than by hand, here's the idiomatic one-liner in the two most common languages.
Python
import json
data = json.loads(formatted_json_string)
minified = json.dumps(data, separators=(',', ':'))
print(minified)The separators=(',', ':') argument tells Python's built-in json module to drop the spaces after commas and colons that it normally adds.
JavaScript (Node.js or browser)
const minified = JSON.stringify(JSON.parse(formattedJsonString));
console.log(minified);JSON.stringify produces compact output by default - no extra arguments needed. Pass it through JSON.parse first if your input is already a string.
How it works under the hood
The tool parses your JSON using the browser's native engine to confirm it's valid, then re-serialises it with no indentation or spacing. This means it catches syntax errors before it compresses - you'll never get silent, broken output. Because parsing and serialising happen entirely in JavaScript on your device, the round trip takes milliseconds even for large files.
When minifying JSON is (and isn't) the right move
| Situation | Use minified JSON? |
|---|---|
| API responses over a network | ✅ Yes - smaller payload, faster transfer |
| Config files you edit manually | ❌ No - keep them readable; use a JSON Beautifier instead |
| Storing JSON in a database field | ✅ Yes - saves column space |
| Debugging or sharing with teammates | ❌ No - use JSON Pretty Print or JSON Viewer |
| Already gzip-compressed responses | ⚠️ Marginal gain - gzip already compresses whitespace well |
| CI pipelines generating JSON artefacts | ✅ Yes - keeps build outputs tidy |
Related tools you might need
- JSON Validator - Check & Fix JSON Errors Online - confirm your JSON is valid before minifying
- JSON Beautifier - Format, Validate & Minify JSON Online - go the other way and add indentation for readability
- JSON to YAML Converter - switch to YAML if your toolchain prefers it
- YAML to JSON Converter - bring YAML config back into JSON
The JSON specification (RFC 8259) formally defines what counts as insignificant whitespace - which is exactly what this tool removes.
Paste your JSON above and get a leaner payload in seconds - no sign-up, no upload, nothing sent anywhere.