📦 JSON Minifier — Compress JSON to Smallest Size

Minify and compress JSON data. Remove all unnecessary whitespace. Free, browser-based, works offline.

How to Use This Tool

  1. Paste your JSON into the input — Click Minify JSON — Compare original vs minified size — Copy the minified output and use in production

Frequently Asked Questions

Is minified JSON still valid?

Yes. Minification only removes whitespace and formatting. The data structure and values remain identical — it's the same valid JSON, just smaller.

When should I minify JSON?

Use minified JSON in production: API responses, configuration files, data storage. Minification reduces bandwidth and parse time. Use formatted JSON during development for readability.

How much size reduction can I expect?

Typically 30-60% depending on formatting. Deeply nested, well-formatted JSON sees the biggest reduction. Already minified JSON won't change.

Related Tools

(function() { function formatBytes(bytes) { if (bytes < 1024) return bytes + ' B'; if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB'; return (bytes / (1024 * 1024)).toFixed(1) + ' MB'; } document.getElementById('jmnMinifyBtn').addEventListener('click', function() { var input = document.getElementById('jmnInput').value.trim(); var errorEl = document.getElementById('jmnError'); errorEl.classList.remove('show'); if (!input) { errorEl.textContent = '⚠️ Please paste some JSON first.'; errorEl.classList.add('show'); return; } try { var parsed = JSON.parse(input); var minified = JSON.stringify(parsed); var originalSize = new Blob([input]).size; var minifiedSize = new Blob([minified]).size; var reduction = originalSize > 0 ? ((originalSize - minifiedSize) / originalSize * 100).toFixed(1) : 0; document.getElementById('jmnOriginalSize').textContent = formatBytes(originalSize); document.getElementById('jmnMinifiedSize').textContent = formatBytes(minifiedSize); document.getElementById('jmnReduction').textContent = (reduction > 0 ? '-' : '') + reduction + '%'; document.getElementById('jmnOutput').value = minified; document.getElementById('jmnStats').style.display = ''; document.getElementById('jmnOutput').style.display = ''; document.getElementById('jmnOutputActions').style.display = ''; window._jmnLastOutput = minified; } catch (e) { errorEl.innerHTML = '❌ Invalid JSON
' + e.message; errorEl.classList.add('show'); document.getElementById('jmnStats').style.display = 'none'; document.getElementById('jmnOutput').style.display = 'none'; document.getElementById('jmnOutputActions').style.display = 'none'; } }); document.getElementById('jmnCopyBtn').addEventListener('click', function() { var output = window._jmnLastOutput || document.getElementById('jmnOutput').value; if (!output) return; navigator.clipboard.writeText(output).then(function() { var btn = document.getElementById('jmnCopyBtn'); btn.textContent = '✅ Copied!'; setTimeout(function() { btn.textContent = '📋 Copy'; }, 1500); }); }); document.getElementById('jmnClearBtn').addEventListener('click', function() { document.getElementById('jmnInput').value = ''; document.getElementById('jmnOutput').value = ''; document.getElementById('jmnOutput').style.display = 'none'; document.getElementById('jmnStats').style.display = 'none'; document.getElementById('jmnOutputActions').style.display = 'none'; document.getElementById('jmnError').classList.remove('show'); window._jmnLastOutput = ''; }); })();

Powered by ToolStand