Will minifying change how my page looks or works?
Only spaces, line breaks and comments that do not affect rendering or behavior are removed. JavaScript only gets shorter variable names and rewrites that keep the same behavior. HTML whitespace collapsing is never applied inside pre, textarea, script or style (script and style are minified as JavaScript and CSS when “Also minify inner <style> and <script>” is on), and one space is kept between elements by default. However, spaces inside elements styled with white-space: pre or similar are collapsed. Wrap such parts in <!-- htmlmin:ignore --> … <!-- htmlmin:ignore --> to leave them untouched. Always check the minified version before you publish it.
It says there is a syntax error
The line and column of the error are shown and your original code is left as it is. Look around that place for an unclosed bracket or quote, or a missing comma. If a <script> or <style> inside HTML has an error, only that part is left unminified and the rest is minified. CSS nesting (the & syntax) and range media queries such as @media (width >= 600px) are not supported; because minifying them would drop rules, they are reported as an error instead.
What is “Gzipped (approx.)”?
Most servers compress files with gzip or similar before sending them. This value is close to what is actually transferred: the browser really gzips the code with CompressionStream and counts the bytes. If your server uses Brotli, the transfer is usually even smaller.
How does the minifier work?
It uses widely used open-source libraries: terser for JavaScript, csso for CSS and html-minifier-terser for HTML. They are hosted on this site and run in your browser, so your code never leaves your device. CSS rules are never reordered or merged, to avoid changing which rule wins.
Can I turn minified code back into the original?
Removed comments and line breaks and shortened variable names cannot be restored. Always keep your original file and edit that one. To put JSON on one line, the JSON Formatter is a better fit.
How large can the code be?
You can open files up to 10 MB. Larger code takes longer; a few megabytes of JavaScript can take several seconds or more.