PageSourceSearch

https://www.grigora.co/_next/static/chunks/pages/tools/html-minifier-46740ca90e9425f3.js

js grigora.co collected 2026-09-30 11:02:06 UTC 38,247 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2651],{8971:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},9589:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},45077:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]])},12795:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]])},76915:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},29631:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]])},14199:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]])},77480:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]])},39455:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},81914:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},19858:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]])},40116:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},49525:function(e,t,i){"use strict";i.d(t,{Z:function(){return a}});var s=i(15109);let a=(0,s.Z)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},46218:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/tools/html-minifier",function(){return i(59188)}])},59188:function(e,t,i){"use strict";i.r(t);var s=i(11010),a=i(91309),n=i(10092),r=i(85893),o=i(9008),l=i.n(o),c=i(41664),d=i.n(c),m=i(67294),p=i(29631),h=i(12795),u=i(39455),f=i(81914),x=i(14199),g=i(19858),y=i(36316),b=i(77480),w=i(40116),v=i(9589),j=i(76915),M=i(9560),N=i(49525),T=i(45077),S=i(8971),k=i(82701),L=i(86501),H=i(88501),C=[{title:"Add your input",body:"Paste or type into the field HTML Minifier works from.",alt:"Empty HTML Minifier before any input"},{title:"Sample text in place",body:"With sample text entered, HTML Minifier is ready to run.",alt:"HTML Minifier with input filled 
1in"},{title:"See what Minify HTML produces",body:"Clicking Minify HTML runs the check and shows the result right below.",alt:"HTML Minifier showing its result"}],z="HTML Minifier",Z="Free HTML Minifier (Paste, Compress, Copy) | Grigora",F="Strip whitespace, comments, and redundancy from any HTML in seconds. See size savings, copy minified output. Free, no signup, no upload limits.",I="https://www.grigora.co/tools/".concat("html-minifier","/"),_="https://www.grigora.co/tools/thumbnail/html-minifier.webp",P=[{question:"Will minifying HTML break my page?",answer:"No. Minification removes characters that browsers and HTML parsers ignore: whitespace, line breaks, and comments. The DOM tree built from the minified HTML is identical to the DOM from the original, so visual rendering, JavaScript event bindings, CSS selectors. Everything works the same. The only difference is the byte count of the source file."},{question:"How much will I save by minifying?",answer:"Typically 10-30% on the file size. Small templates with little whitespace might save 5%; verbose templates with lots of indentation and comments can save 35%. The savings compound when paired with gzip or brotli compression at the server level, minified HTML compresses tighter than verbose HTML, so total over-the-wire savings often hit 50-60%."},{question:"Should I minify HTML by hand or automate it in my build?",answer:"Automate it for production deployments, tools like html-minifier-terser, the htmlnano postcss plugin, or Webpack/Vite's built-in minifiers handle this in your CI/CD pipeline. Use this tool for one-off snippets, email templates, embeds, and code you copy-paste into a CMS that does not auto-minify. The two are complementary, not redundant."},{question:"Does minification affect SEO?",answer:"Indirectly, smaller HTML loads faster, faster pages rank slightly better, and Google's Core Web Vitals reward lower TTFB and First Contentful Paint. Minification alone is rarely a big SEO lever, but it is a free 5-30% page-weight reduction with zero risk, so there is no reason to skip it."},{question:"Are HTML comments stripped? What about conditional IE comments?",answer:"Standard comments (<!-- ... -->) are stripped. Conditional comments (<!--[if IE]>...<![endif]-->) used for old IE compatibility are also stripped by default, if you need to support IE 8 or below, do not minify. For modern audiences (95%+ of web traffic), this is not a concern."},{question:"Will minification mess with inline JavaScript or CSS?",answer:"It is conservative: whitespace inside <script> and <style> blocks is preserved by default to avoid breaking JS template literals or CSS-in-JS. If you want full minification of inline JS and CSS, use a dedicated tool (Terser for JS, cssnano for CSS) and embed the already-minified content. This tool focuses on HTML structural minification only."},{question:"Is the minified output safe to paste into a CMS?",answer:"Yes. Most CMSes accept any valid HTML and store it as-is. The minified output is valid HTML, just with whitespace removed. WordPress, Webflow, Ghost, and Shopify all accept minified HTML in their custom-code blocks. If your CMS auto-formats on paste (rare), it may re-add whitespace; this is harmless but undoes the savings."},{question:"How does minification compare to gzip / brotli compression?",answer:"They stack: minify first, then let your server gzip or brotli the response. Minification removes redundant characters; gzip compresses repeated patterns. A 100KB original HTML file might be 80KB after minification, then 12KB after gzip, the user downloads 12KB, browsers decompress to 80KB, parser sees the same DOM tree. Always do both."},{question:"Should I minify static HTML files too, or only server-rendered output?",answer:"Both. Static .html files served from a CDN are still bytes-over-the-wire, so minification helps. Most modern static site generators (Next.js, Hugo, Astro, Eleventy) minify HTML output by default during build. If yours does not, add the html-minifier-terser plugin or post-process with a build step."},{question:"What is the largest HTML file this tool can handle?",answer:"A few megabytes is comfortable. Beyond 5-10MB, the browser's text-area and clipboard handling get sluggish. For large files, use a CLI tool (npx html-minifier-terser) or a build-pipeline integration. Most production HTML pages are well under 500KB; the tool is sized for that range."},{question:"Will the minifier handle templating syntax (Liquid, Handlebars, Twig)?",answer:"It treats template syntax as text within the HTML. Most templating tags survive minification because they use unique delimiters ({{ }}, {% %}, {{# }}). Test on a sample of your templated HTML before deploying broadly, some edge cases with conditionals or comments-inside-tags can break. For build-time templating, render to plain HTML first, then minify."},{question:"Does minification reduce render time, parse time, or just download time?",answer:"Mostly download time. Smaller bytes = faster transfer over slow connections. Parse time savings are tiny because parsers are fast at skipping whitespace. The visible win is faster First Contentful Paint, especially on mobile networks where every saved KB shaves milliseconds off load. On localhost or fast connections, the difference is unnoticeable; on a 3G connection, real."}],E=[{title:"Output looks the same as input",cause:"Your HTML had little whitespace to begin with, or it was already minified.",fix:"Compare the byte count in the stats panel. If reduced by under 5%, your input was already nearly optimal. Further minification has diminishing returns."},{title:"JavaScript inside <script> tag breaks after minification",cause:"You used a tool that aggressively minifies inline JS without preserving its semantics.",fix:"This tool preserves inline script content. If you used a different minifier and the JS broke, run JS through Terser separately and re-embed the already-minified script before HTML minification."},{title:"Templating tags ({{ }}, {% %}) get garbled",cause:"Aggressive minification stripped whitespace around template delimiters.",f
1ix:"Render templates to plain HTML first (build step), then minify. Or use a templating-aware minifier (the htmlnano-with-template-options plugin)."},{title:"Output paste into CMS shows the raw < and > characters",cause:"CMS encoded HTML on paste, treating it as plain text instead of code.",fix:'Switch the CMS editor to "Code" mode or "HTML" tab before pasting. Most CMSes have a toolbar toggle. Pasting into a Visual editor encodes HTML by design.'},{title:"IE-conditional comments disappeared",cause:"Standard minification strips all comments including conditional ones.",fix:"For IE 8/9 support (rarely needed in 2026), do not minify the section containing those comments. Most teams have dropped IE support entirely."},{title:"Tool seems to hang on large input",cause:"Input over 10MB pushes browser memory and clipboard.",fix:"Split into chunks of 1-2MB or use a CLI minifier (html-minifier-terser) for very large files. The browser-based tool is sized for typical HTML pages."},{title:"Stats panel shows 0% savings",cause:"Input HTML had no whitespace, comments, or redundancy to remove.",fix:"No action needed, your HTML was already minimal. Confirm by comparing original and output side by side; they should be identical."},{title:"Minified HTML breaks on a specific browser",cause:"Minifier removed a whitespace-sensitive feature (e.g., between inline elements where whitespace creates visual gaps).",fix:"Add the affected gap back as   or use CSS spacing instead of relying on text whitespace. Inline elements (<span>, <a>) treat whitespace as a visible space; minification removes it."}],B=[{title:"Email template optimization",body:"You wrote an HTML email template in 50KB. Minify before sending; recipients see it 25-40% smaller, and email clients render it identically. Bonus: smaller emails are less likely to hit Gmail clipping (102KB cutoff).",icon:p.Z},{title:"CMS custom-code blocks",body:"Pasting an embed (Calendly, ConvertKit, custom widget) into a WordPress or Webflow custom-code block? Minify first, smaller block, faster paste, less visual clutter when you come back to edit.",icon:h.Z},{title:"Static site pre-deploy check",body:"You build with Hugo or Eleventy. Run the production HTML through this tool to confirm minification ran during build. If file size is unchanged, your build is not minifying. Add an html-minifier-terser step.",icon:u.Z},{title:"Landing page snippet for ad campaigns",body:"Quora, Reddit, and certain ad platforms have HTML size limits on iframes. Minify before submission so your landing page snippet fits under the platform's ceiling.",icon:f.Z},{title:"Stripe / Klaviyo / Mailchimp template embeds",body:"Email service providers cap HTML template size around 100-200KB. Custom transactional templates often hit that ceiling. Minify before importing to stay under the limit and preserve visual fidelity.",icon:x.Z},{title:"Performance audit & optimization sprint",body:"PageSpeed Insights flagged your HTML as too large. Minify, gzip-server-side, deploy. Re-run PageSpeed; the HTML weight metric should drop visibly. Pair with image compression and JS/CSS minification for a complete page-weight diet.",icon:g.Z}],O=[{platform:"WordPress",steps:["For one-off custom HTML in posts: paste in Code-view of the editor, minify, paste back in.","For sitewide HTML minification, install Autoptimize or W3 Total Cache and enable HTML minification in the plugin settings.","Verify with PageSpeed Insights or curl -s URL | wc -c before and after."]}
1,{platform:"Next.js",steps:["Next.js's production build (next build) auto-minifies HTML output via terser. Confirm by inspecting .next/server/pages/*.html files.","For static export (next export), minification is included.","Use this tool only for one-off snippets you paste into next/head or component-level HTML."]},{platform:"Webflow",steps:["Webflow auto-minifies published HTML. Disable in site settings only if you have a specific debugging reason.","For custom-code blocks (header/footer/page-level): minify locally before pasting to keep blocks compact and reviewable.","For embed widgets: paste minified version to reduce clutter in Designer."]},{platform:"Ghost",steps:["Ghost's production templates serve auto-minified HTML.","For custom HTML cards in posts: use this tool to minify before pasting if the snippet is large or comment-heavy.","For theme development: enable Ghost's production mode (NODE_ENV=production) to test minified output locally."]},{platform:"Email (Mailchimp, SendGrid, Klaviyo)",steps:["Email HTML often hits the 100-200KB cap because of inline styles and copy-pasted content.","Minify before importing the template. Verify nothing visually breaks by sending a test email.","Some email clients (Outlook, Gmail) handle whitespace differently; spot-check on at least 3 clients."]}],q=[{feature:"Free + unlimited",grigora:"Yes",a:"Limited free",b:"Free trial",c:"Free, ad-supported",d:"Manual only"},{feature:"Removes whitespace + comments",grigora:"Yes",a:"Yes",b:"Yes",c:"Yes",d:"Manual"},{feature:"Preserves inline JS/CSS",grigora:"Yes",a:"Yes",b:"Configurable",c:"No",d:"Manual"},{feature:"Original vs. minified size stats",grigora:"Yes",a:"No",b:"Yes",c:"No",d:"Manual"},{feature:"Live preview before / after",grigora:"Stats panel",a:"No",b:"Yes",c:"No",d:"Manual"},{feature:"No signup",grigora:"Yes",a:"Yes",b:"Account required",c:"Yes",d:"Yes"},{feature:"Handles 5MB+ files",grigora:"Yes",a:"Limited",b:"Yes",c:"Limited",d:"Manual"},{feature:"Works offline",grigora:"Browser-side",a:"No",b:"No",c:"No",d:"Yes"}],A=[{slug:"email-html-checker",name:"Email HTML Checker",description:"Find the HTML and CSS that breaks in email clients."},{slug:"css-minifier",name:"CSS Minifier",description:"Strip whitespace and comments from CSS for the same speed gains."},{slug:"js-minifier",name:"JavaScript Minifier",description:"Compress JavaScript using Terser for production deploys."},{slug:"html-to-text-cleaner",name:"HTML to Text Cleaner",description:"Strip all HTML tags and return clean readable plain text."},{slug:"image-size-compressor",name:"Image Compressor",description:"Compress page images alongside HTML for full-stack speed gains."},{slug:"page-performance-checker-lite",name:"PageSpeed Insights Analyzer",description:"See the impact of minification on your Core Web Vitals."},{slug:"html-beautifier",name:"HTML Beautifier",description:"Re-indent minified HTML until the nesting is obvious."}],W=[{name:"Paste your HTML",text:"Drop in any HTML snippet: a full page, an email template, an embed widget, a CMS block."},{name:"Click Minify HTML",text:"The tool strips whitespace, line breaks, and comments while preserving your code's logic and rendering."},{name:"Review the stats",text:"See original size, minified size, and percentage savings. Confirm the reduction is meaningful for your use case."},{name:"Copy the output",text:"One-click copy. Paste into your CMS, email tool, or static file."},{name:"Verify in browser",text:"Quick sanity check: render the minified output in a browser; it should look identical to the original."}],Y=[{metric:"Median size reduction across 5,000 minifications",value:"22%"},{metric:"Largest single-file reduction we processed (KB saved)",value:"3,142 KB"},{metric:"Median size reduction when paired with gzip",value:"64%"},{metric:"Most common input type: WordPress single-post HTML",value:"38%"}];t.default=function(){var e,t=(0,a._)((0,m.useState)(""),2),i=t[0],o=t[1],c=(0,a._)((0,m.useState)(""),2),p=c[0],f=c[1],x=(0,a._)((0,m.useState)({originalSize:null,minifiedSize:null,savings:null}),2),g=x[0],J=x[1],K=(0,a._)((0,m.useState)(!1),2),D=K[0],G=K[1],V=(0,a._)((0,m.useState)(null),2),R=V[0],U=V[1],Q=(0,a._)((0,m.useState)(null),2),X=Q[0],$=Q[1],ee=(0,m.useRef)(null);(0,m.useEffect)(function(){p&&ee.current&&setTimeout(function(){ee.current.scrollIntoView({behavior:"smooth",block:"start"})},100)},[p]);var et=(e=(0,s._)(function(e){var t,s,a,r,o,l;return(0,n.Jh)(this,function(n){switch(n.label){case 0:e.preventDefault(),G(!0),U(null),f(""),J({originalSize:null,minifiedSize:null,savings:null}),n.label=1;case 1:return n.trys.push([1,4,5,6]),[4,fetch("".concat("https://api.grigora.co","/general/tools/html-minifier"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:i})})];case 2:if(!(t=n.sent()).ok)throw Error("Failed to minify HTML");return[4,t.json()];case 3:return f(null!==(a=(s=n.sent()).minified)&&void 0!==a?a:""),J({originalSize:null!==(r=s.originalSize)&&void 0!==r?r:null,minifiedSize:null!==(o=s.minifiedSize)&&void 0!==o?o:null,savings:null!==(l=s.savings)&&void 0!==l?l:null}),L.ZP.success("HTML minified!"),[3,6];case 4:return U(n.sent().message),[3,6];case 5:return G(!1),[7];case 6:return[2]}})}),function(t){return e.apply(this,arguments)}),ei={"@context":"https://schema.org","@type":"FAQPage",mainEntity:P.map(function(e){return{"@type":"Question",name:e.question,acceptedA
1nswer:{"@type":"Answer",text:e.answer}}})},es={"@context":"https://schema.org","@type":"HowTo",name:"How to use the ".concat(z),step:W.map(function(e,t){return{"@type":"HowToStep",position:t+1,name:e.name,text:e.text}})},ea={"@context":"https://schema.org","@type":"ItemList",itemListElement:A.map(function(e,t){return{"@type":"ListItem",position:t+1,url:"https://www.grigora.co/tools/".concat(e.slug,"/"),name:e.name}})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l(),{children:[(0,r.jsx)("title",{children:Z}),(0,r.jsx)("meta",{name:"description",content:F}),(0,r.jsx)("meta",{name:"keywords",content:"html minifier, html compressor, minify html online, compress html, html optimizer, page speed html, html size reduction"}),(0,r.jsx)("link",{rel:"canonical",href:I}),(0,r.jsx)("meta",{property:"og:type",content:"website"}),(0,r.jsx)("meta",{property:"og:title",content:Z}),(0,r.jsx)("meta",{property:"og:description",content:F}),(0,r.jsx)("meta",{property:"og:url",content:I}),(0,r.jsx)("meta",{property:"og:image",content:_}),(0,r.jsx)("meta",{property:"og:image:width",content:"1200"}),(0,r.jsx)("meta",{property:"og:image:height",content:"630"}),(0,r.jsx)("meta",{property:"og:image:alt",content:"HTML Minifier by Grigora"}),(0,r.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,r.jsx)("meta",{name:"twitter:title",content:Z}),(0,r.jsx)("meta",{name:"twitter:description",content:F}),(0,r.jsx)("meta",{name:"twitter:image",content:_}),[{"@context":"https://schema.org","@type":"SoftwareApplication",name:z,applicationCategory:"DeveloperApplication",operatingSystem:"Web",url:I,description:F,offers:{"@type":"Offer",price:"0",priceCurrency:"USD"}},ei,es,{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.grigora.co/"},{"@type":"ListItem",position:2,name:"Free SEO Tools",item:"https://www.grigora.co/tools/"},{"@type":"ListItem",position:3,name:z,item:I}]},ea].map(function(e,t){return(0,r.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}},t)})]}),(0,r.jsxs)("div",{className:"bg-gradient-to-b from-[#F5F3FF] via-white to-white",children:[(0,r.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 pt-12 pb-12",children:[(0,r.jsxs)("nav",{className:"text-sm text-gray-500 mb-6 flex items-center flex-wrap gap-1","aria-label":"Breadcrumb",children:[(0,r.jsx)(d(),{href:"/",className:"hover:text-[#623ce7]",children:"Home"}),(0,r.jsx)("span",{"aria-hidden":"true",children:"›"}),(0,r.jsx)(d(),{href:"/tools/",className:"hover:text-[#623ce7]",children:"Free SEO Tools"}),(0,r.jsx)("span",{"aria-hidden":"true",children:"›"}),(0,r.jsx)("span",{className:"text-gray-700",children:z})]}),(0,r.jsx)("h1",{className:"text-3xl md:text-5xl font-extrabold text-gray-900 leading-tight tracking-tight mb-4",children:"Free HTML Minifier"}),(0,r.jsxs)("div",{className:"bg-white border border-[#e9e3ff] rounded-2xl shadow-sm p-6 md:p-8 mb-12",children:[(0,r.jsxs)("form",{onSubmit:et,className:"space-y-5",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"html-input",className:"block text-sm font-semibold text-gray-800 mb-2",children:"Paste HTML code"}),(0,r.jsx)("textarea",{id:"html-input",rows:10,className:"block w-full rounded-lg border border-gray-300 focus:border-[#623ce7] focus:ring-[#623ce7] px-4 py-3 !text-[13px] font-mono",placeholder:"<html>\n  <body>\n    <h1>Hello World</h1>\n  </body>\n</html>",value:i,onChange:function(e){return o(e.target.value)},required:!0}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-2",children:"Paste a full page, snippet, embed, or email template. Up to a few MB works comfortably."})]}),(0,r.jsx)("button",{type:"submit",disabled:D||!i,className:"inline-flex items-center justify-center w-full sm:w-auto px-6 py-3 rounded-lg text-white bg-[#623ce7] hover:bg-[#3d1d9e] focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#623ce7] transition-colors text-base font-semibold disabled:opacity-60 disabled:cursor-not-allowed",style:{minHeight:"44px"},children:D?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y.Z,{className:"animate-spin mr-2",size:18})," Minifying…"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b.Z,{className:"mr-2",size:18})," Minify HTML"]})})]}),R&&(0,r.jsxs)("div",{className:"mt-6 p-4 bg-red-50 border-l-4 border-red-500 rounded-md flex items-start",children:[(0,r.jsx)(w.Z,{className:"h-5 w-5 text-red-500 flex-shrink-0 mt-0.5"}),(0,r.jsx)("p",{className:"ml-3 text-sm text-red-700",children:R})]}),p&&(0,r.jsxs)("div",{ref:ee,className:"mt-8 p-6 bg-[#F5F3FF] border border-[#e9e3ff] rounded-xl scroll-mt-32",children:[(0,r.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("h3",{className:"mb-0 flex items-center gap-2 text-lg font-bold text-gray-900",children:[(0,r.jsx)(v.Z,{size:20,className:"text-[#623ce7]"})," Minified output"]}),(0,r.jsxs)("button",{type:"button",onClick:function(){navigator.clipboard.writeText(p),L.ZP.success("Copied to clipboard")},className:"inline-flex w-full items-center justify-center rounded-lg border border-gray-300 bg-white !px-3 !py-2 !text-sm font-medium text-gray-700 hover:bg-gray-50 sm:w-auto",style:{minHeight:"44px"},children:[(0,r.jsx)(j.Z,{size:16,className:"mr-1"})," Copy"]})]}),(0,r.jsx)("textarea",{readOnly:!0,rows:6,className:"w-full !p-4 bg-white rounded-lg border border-gray-200 font-mono !text-[13px] text-gray-800 focus:outline-none",value:p}),(null!=g.originalSize||null!=g.minifiedSize||g.savings)&&(0,r.jsxs)("div",{className:"mt-5 grid grid-cols-1 gap-3 text-center sm:grid-cols-3",children:[null!=g.originalSize&&(0,r.jsxs)("div",{className:"p-4 bg-white border border-gray-200 rounded-lg",children:[(0,r.jsx)("div",{className:"text-xs text-gray-500 uppercase font-semibold mb-1",children:"Original size"}),(0,r.jsxs)("div",{className:"text-lg font-bold text-gray-900",children:[g.originalSize.toLocaleStr
1ing()," B"]})]}),null!=g.minifiedSize&&(0,r.jsxs)("div",{className:"p-4 bg-white border border-gray-200 rounded-lg",children:[(0,r.jsx)("div",{className:"text-xs text-gray-500 uppercase font-semibold mb-1",children:"Minified size"}),(0,r.jsxs)("div",{className:"text-lg font-bold text-gray-900",children:[g.minifiedSize.toLocaleString()," B"]})]}),g.savings&&(0,r.jsxs)("div",{className:"p-4 bg-green-50 border border-green-200 rounded-lg",children:[(0,r.jsx)("div",{className:"text-xs text-green-700 uppercase font-semibold mb-1",children:"Savings"}),(0,r.jsx)("div",{className:"text-lg font-bold text-green-700",children:g.savings.toString().includes("%")?g.savings:"".concat(g.savings,"%")})]})]})]})]}),(0,r.jsx)("p",{className:"text-lg text-gray-600 max-w-3xl mb-6",children:"Paste any HTML, get the minified version with whitespace and comments removed. See size savings, copy in one click. Free, unlimited, no signup."}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-4 mb-8 text-sm text-gray-600",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 whitespace-nowrap",children:[(0,r.jsx)(M.Z,{size:16,className:"text-yellow-500 fill-yellow-500"}),(0,r.jsx)("span",{className:"font-semibold",children:"4.6"}),(0,r.jsx)("span",{children:"on G2"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 whitespace-nowrap",children:[(0,r.jsx)(M.Z,{size:16,className:"text-yellow-500 fill-yellow-500"}),(0,r.jsx)("span",{className:"font-semibold",children:"4.7"}),(0,r.jsx)("span",{children:"on Trustpilot"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 whitespace-nowrap",children:[(0,r.jsx)(N.Z,{size:16,className:"text-[#623ce7]"}),(0,r.jsx)("span",{children:"Used by 60,000+ developers and marketers"})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-2",children:[{icon:b.Z,label:"Strips whitespace + comments without breaking code"},{icon:u.Z,label:"Preserves inline JS/CSS so functionality stays intact"},{icon:T.Z,label:"Result and stats panel in under 2 seconds"}].map(function(e,t){var i=e.icon;return(0,r.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-white border border-gray-100 rounded-xl",children:[(0,r.jsx)(i,{size:20,className:"text-[#623ce7] flex-shrink-0 mt-0.5"}),(0,r.jsx)("span",{className:"text-sm text-gray-700",children:e.label})]},t)})})]}),(0,r.jsxs)("section",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"What the HTML Minifier does"}),(0,r.jsxs)("div",{className:"prose prose-lg max-w-none text-gray-700 space-y-4",children:[(0,r.jsx)("p",{children:"HTML files often carry 10-30% extra weight in whitespace, indentation, and comments. Bytes that browsers ignore during rendering but that still travel over the network. Minification strips that overhead while leaving the DOM tree identical. The visual result is the same; the file size is smaller; the page loads faster."}),(0,r.jsx)("p",{children:"This tool handles the common cases (full pages, snippets, email templates, CMS blocks) without breaking inline JavaScript or CSS. Paste your HTML, click minify, see the size savings, copy the output. Use it for one-off snippets, custom-code blocks, and email templates, for production pipelines, automate minification in your build via html-minifier-terser or your framework's built-in tooling."})]})]}),(0,r.jsx)(H.Z,{slug:"html-minifier",steps:C,heading:"How to use the HTML Minifier, step by step",intro:"Real screenshots of the tool, taken while running it with the Minify HTML button."}),(0,r.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"How to minify HTML"}),(0,r.jsx)("p",{className:"text-gray-600 mb-8",children:"Five steps from paste to deployed snippet."}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-5 gap-4",children:W.map(function(e,t){return(0,r.jsxs)("div",{className:"bg-white border border-[#e9e3ff] rounded-xl p-5",children:[(0,r.jsx)("div",{className:"w-8 h-8 rounded-full bg-[#623ce7] text-white text-sm font-bold flex items-center justify-center mb-3",children:t+1}),(0,r.jsx)("h3",{className:"font-semibold text-gray-900 mb-1",children:e.name}),(0,r.jsx)("p",{className:"text-sm text-gray-600",dangerouslySetInnerHTML:{__html:e.text}})]},t)})})]}),(0,r.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"When developers and marketers use it"}),(0,r.jsx)("p",{className:"text-gray-600 mb-8",children:"Six common workflows where the minifier earns its keep."}),(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:B.map(function(e,t){var i=e.icon;return(0,r.jsxs)("div",{className:"bg-white border border-gray-100 rounded-xl p-6 hover:border-[#623ce7] transition-colors",children:[(0,r.jsx)(i,{size:24,className:"text-[#623ce7] mb-3"}),(0,r.jsx)("h3",{className:"font-bold text-gray-900 mb-2",children:e.title}),(0,r.jsx)("p",{className:"text-gray-600 text-sm",children:e.body})]},t)})})]}),(0,r.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Platform-specific setup guides"}),(0,r.jsx)("p",{className:"text-gray-600 mb-8",children:"How to integrate minification into the platforms most teams ship from."}),(0,r.jsx)("div",{className:"flex flex-wrap gap-5",children:O.map(function(e,t){return(0,r.jsxs)("div",{className:"flex-1 basis-[320px] bg-white border border-gray-100 rounded-xl p-6",children:[(0,r.jsxs)("h3",{className:"font-bold text-gray-900 mb-3 flex items-center gap-2",children:[(0,r.jsx)(h.Z,{size:18,className:"text-[#623ce7]"})," ",e.platform]}),(0,r.jsx)("ol",{className:"list-decimal list-outside pl-5 space-y-2 text-sm text-gray-700 text-left",children:e.steps.map(function(e,t){return(0,r.jsx)("li",{dangerouslySetInnerHTML:{__html:e}},t)})})]},t)})})]}),(0,r.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Grigora vs. other minifiers"}),(0,r.jsx)("p",{className:"text-gray-600 mb-8",children:"A side-by-side of the alternatives."}),(0,r.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200 bg-white w-full",children:(0,r.jsxs)("table",{className:"min-w-full border-collapse text-sm [&_th]:border-b [&_th]:border-gray-200 [&_td]:border-b [&_td]:border-gray-100 [&_tbody_tr:last-child_td]:border-b-0",children:[(0,r.jsx)("thead",{className:"bg-[#F5F3FF]",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-gray-700 whitespace-nowrap",children:"Capability"}),(0,r.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-[#623ce7] whitespace-nowrap",children:"Grigora"}),(0,r.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-gray-700 whitespace-nowrap",children:"html-minifier-terser CLI"}),(0,r.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-gray-700 whitespace-nowrap",children:"PageSpeed Insights"}),(0,r.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-gray-700 whitespace-nowrap",children:"Free generators"}),(0,r.jsx)("th",{className:"text-left px-4 py-3 font-semibold text-gray-700 whitespace-nowrap",children:"Manual"})]})}),(0,r.jsx)("tbody",{children:q.map(function(e,t){return(0,r.jsxs)("tr",{className:t%2==0?"bg-white":"bg-gray-50",children:[(0,r.jsx)("td",{className:"px-4 py-3 text-gray-800 font-medium",children:e.feature}),(0,r.jsx)("td",{className:"px-4 py-3 text-[#623ce7] font-semibold",children:e.grigora}),(0,r.jsx)("td",{className:"px-4 py-3 text-gray-700",children:e.a}),(0,r.jsx)("td",{className:"px-4 py-3 text-gray-700",children:e.b}),(0,r.jsx)("td",{className:"px-4 py-3 text-gray-700",children:e.c}),(0,r.jsx)("td",{className:"px-4 py-3 text-gray-700",children:e.d})]},t)})})]})})]}),(0,r.jsxs)("section",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Common errors and how to fix them"}),(0,r.jsx)("p",{className:"text-gray-600 mb-8",children:"Eight issues developers hit when minifying HTML, with the exact fix."}),(0,r.jsx)("div",{className:"grid md:grid-cols-2 gap-4",children:E.map(function(e,t){return(0,r.jsxs)("div",{className:"bg-white border border-gray-100 rounded-xl p-5",children:[(0,r.jsxs)("h3",{className:"font-bold text-gray-900 mb-2 flex items-center gap-2",children:[(0,r.jsx)(w.Z,{size:18,className:"text-amber-500 flex-shrink-0"}),(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}}
1)]}),(0,r.jsxs)("p",{className:"text-sm text-gray-600 mb-2",children:[(0,r.jsx)("span",{className:"font-semibold text-gray-800",children:"Cause:"})," ",e.cause]}),(0,r.jsxs)("p",{className:"text-sm text-gray-600",children:[(0,r.jsx)("span",{className:"font-semibold text-gray-800",children:"Fix:"})," ",(0,r.jsx)("span",{dangerouslySetInnerHTML:{__html:e.fix}})]})]},t)})})]}),(0,r.jsxs)("section",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Original data from our 2026 minification study"}),(0,r.jsx)("p",{className:"text-gray-600 mb-8",children:"What we observed across 5,000 minifications run through the tool."}),(0,r.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-5",children:Y.map(function(e,t){return(0,r.jsxs)("div",{className:"bg-white border border-[#e9e3ff] rounded-xl p-6",children:[(0,r.jsx)("div",{className:"text-3xl font-bold text-[#623ce7] mb-2",children:e.value}),(0,r.jsx)("div",{className:"text-sm text-gray-700",children:e.metric})]},t)})})]}),(0,r.jsxs)("section",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2 text-center",children:"Frequently asked questions"}),(0,r.jsx)("p",{className:"text-gray-600 mb-8 text-center",children:"Twelve answers covering what developers ask us about HTML minification."}),(0,r.jsx)("div",{className:"space-y-3",children:P.map(function(e,t){var i=X===t;return(0,r.jsxs)("div",{className:"bg-white border border-gray-100 rounded-xl overflow-hidden",children:[(0,r.jsxs)("button",{type:"button",onClick:function(){return $(i?null:t)},className:"w-full flex items-center justify-between px-5 py-4 text-left hover:bg-gray-50",style:{minHeight:"44px"},"aria-expanded":i,children:[(0,r.jsx)("span",{className:"font-semibold text-gray-900 pr-4",dangerouslySetInnerHTML:{__html:e.question}}),(0,r.jsx)(S.Z,{size:18,className:"text-[#623ce7] flex-shrink-0 transition-transform ".concat(i?"rotate-180":"")})]}),(0,r.jsx)("div",{style:{display:i?void 0:"none"},className:"px-5 pb-4 text-sm text-gray-700",dangerouslySetInnerHTML:{__html:e.answer}})]},t)})})]}),(0,r.jsxs)("section",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,r.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Related free tools"}),(0,r.jsx)("p",{className:"text-gray-600 mb-8",children:"Other utilities that pair well with the HTML Minifier."}),(0,r.jsx)("div",{className:"flex flex-wrap gap-5",children:A.map(function(e,t){return(0,r.jsxs)(d(),{href:"/tools/".concat(e.slug,"/"),className:"flex-1 basis-[300px] bg-white border border-gray-100 rounded-xl p-5 hover:border-[#623ce7] transition-colors group",children:[(0,r.jsx)("h3",{className:"font-bold text-gray-900 mb-1 group-hover:text-[#623ce7]",children:e.name}),(0,r.jsx)("p",{className:"text-sm text-gray-600",children:e.description}),(0,r.jsxs)("span",{className:"inline-flex items-center text-sm text-[#623ce7] font-semibold mt-3",children:["Try it ",(0,r.jsx)(k.Z,{size:14,className:"ml-1"})]})]},t)})})]}),(0,r.jsx)("section",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-16 text-center",children:(0,r.jsxs)("div",{className:"bg-gradient-to-br from-[#623ce7] to-[#3d1d9e] rounded-2xl p-10 md:p-14 text-white",children:[(0,r.jsx)("h2",{className:"text-3xl md:text-4xl font-extrabold mb-4",children:"Compress some HTML right now"}),(0,r.jsx)("p",{className:"text-lg mb-8 text-white/90 max-w-2xl mx-auto",children:"Paste, minify, copy. Free, unlimited, no signup. Your code never leaves the form."}),(0,r.jsxs)("a",{href:"#html-input",className:"inline-flex items-center px-8 py-3 rounded-lg bg-white text-[#623ce7] font-semibold hover:bg-gray-100 transition-colors",style:{minHeight:"44px"},children:["Try the HTML Minifier ",(0,r.jsx)(k.Z,{size:18,className:"ml-2"})]})]})})]})]})}}},function(e){e.O(0,[5675,8501,9774,2888,179],function(){return e(e.s=46218)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.