Suggest an editImprove this articleRefine the answer for “What does minification do?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Minification** is the process of compressing JavaScript, CSS, and HTML files by removing everything not needed for execution, in order to reduce their size. **Key point:** minification is a way to compress code to its limit so it's as small as possible and reaches the user faster.Shown above the full answer for quick recall.Answer (EN)Image**Minification** is the process of compressing JavaScript, CSS, and HTML files by removing everything not needed for execution, in order to reduce their size. --- ### What a minifier does: 1. **Removes whitespace, line breaks, and tabs** Before: ```js function sum(a, b) { return a + b; } ``` After: ```js function sum(a,b){return a+b;} ``` 2. **Renames variables and functions** Long names get shortened to `a`, `b`, `c`, and so on. 3. **Removes comments** 4. **Inlines and optimizes expressions** Merges statements, removes unnecessary constructs. 5. **Sometimes: removes "dead" code** (if a production build and tree shaking are enabled) --- ### Result: - file size shrinks by 30-90% - the code becomes unreadable, but works the same - it loads faster and parses faster --- ### Examples of minifiers: - **Terser** (for JS) - **esbuild, SWC** (newer generation) - **csso, clean-css** (for CSS) - **html-minifier** (for HTML) --- **Conclusion:** Minification is a way to compress code to its limit so it's as small as possible and reaches the user faster.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.