Code Minifier

Shrink CSS, JavaScript, HTML, JSON and XML by removing comments and whitespace, and see how much you saved. Runs entirely in your browser.

Sponsored
This is a fast, safe structural minifier (it strips comments and needless whitespace). It is not a full compiler like Terser — it won't rename variables or do advanced optimisation, so the output stays behaviourally identical.
Sponsored

Frequently asked questions

Is the minified JavaScript safe to run?

Yes. The JS minifier only strips comments and collapses whitespace while preserving strings, template literals and regex contents, so behaviour is unchanged. It doesn't rename variables, so it won't break references — but for production builds a full tool like Terser compresses further.

Does minifying JSON validate it?

Yes. JSON is parsed and re-serialised, so invalid JSON is reported as an error rather than silently mangled.

Will HTML minifying break my page?

It removes comments (keeping IE conditional comments) and collapses whitespace between tags. This is safe for typical markup, though be mindful of significant whitespace inside

 or 
      

Or use the full contact form.

`; document.body.appendChild(fab); document.body.appendChild(panel); const close = () => panel.classList.remove("open"); fab.addEventListener("click", () => { panel.classList.toggle("open"); if (panel.classList.contains("open")) panel.querySelector("#sgMsg").focus(); }); panel.querySelector(".suggest-close").addEventListener("click", close); document.addEventListener("keydown", e => { if (e.key === "Escape") close(); }); document.addEventListener("click", e => { if (panel.classList.contains("open") && !panel.contains(e.target) && !fab.contains(e.target)) close(); }); panel.querySelector("#sgAnother").addEventListener("click", () => { panel.querySelector("#suggestForm").style.display = ""; panel.querySelector("#suggestThanks").style.display = "none"; panel.querySelector("#sgMsg").value = ""; }); panel.querySelector("#sgSend").addEventListener("click", async () => { const msg = panel.querySelector("#sgMsg").value.trim(); if (!msg) { showToast("Write a message first"); return; } const payload = { "form-name": "suggestion", topic: panel.querySelector("#sgType").value, message: msg, email: panel.querySelector("#sgEmail").value.trim(), page: window.location.pathname, }; // Always keep a local copy so the message is never lost. try { const saved = JSON.parse(localStorage.getItem("alldays_suggestions") || "[]"); saved.unshift({ ...payload, at: new Date().toISOString() }); localStorage.setItem("alldays_suggestions", JSON.stringify(saved.slice(0, 20))); } catch (e) {} let sent = false; try { const res = await fetch("/", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams(payload).toString(), }); sent = res.ok; } catch (e) { sent = false; } panel.querySelector("#sgThanksMsg").textContent = sent ? "We read every one of these." : "Saved. If this site isn't on Netlify yet, the form endpoint may not be live — you can also use the contact page."; panel.querySelector("#suggestForm").style.display = "none"; panel.querySelector("#suggestThanks").style.display = ""; }); } document.addEventListener("DOMContentLoaded", mountSuggestBox);