HTML / CSS Minifier
Strip whitespace and line breaks to compress code
Paste an HTML or CSS snippet to remove comments, extra whitespace and line breaks, compressing your code and showing the size savings instantly.
Minified code will appear here.About the html / css minifier
Minification removes characters that browsers do not need — comments, line breaks, and repeated whitespace — without changing how the code works. The result is a smaller file that downloads and parses faster, which is especially valuable on mobile networks and for large stylesheets.
This tool minifies HTML and CSS. HTML minification collapses whitespace between tags while keeping the meaningful content of <pre>, <textarea>, <script>and <style> blocks intact. CSS minification strips comments and unnecessary spaces around braces, colons, and semicolons.
Options
- HTML — collapse whitespace between tags and remove comments.
- CSS — strip comments and spaces around punctuation.
- Size savings — see the byte size before and after, plus the percentage saved.
How to use the html / css minifier
Choose HTML or CSS
Pick the mode that matches the snippet you want to compress.
Paste your code
Drop your HTML or CSS into the input box — indentation and comments are fine.
Copy the minified output
The compressed code and size savings appear live — click Copy to use it.
Frequently asked questions
What does minification do?
Will minification break my HTML formatting?
Does it remove CSS comments?
How much size will I save?
Is my code uploaded anywhere?
Explore more utilities
More like this
Other utilities
- Word UnscramblerFind every word from jumbled letters
- Anagram SolverFind anagrams of any word
- Word CounterCount words, characters & sentences
- Word FinderFind words matching a pattern
- Random Word GeneratorGenerate random dictionary words
- Character CounterCount characters with & without spaces
- Case ConverterConvert text to upper, lower, title & more
- Text CleanerRemove extra spaces, blank lines & junk
- Remove Duplicate LinesDelete repeated lines from any text
- Sort LinesSort lines alphabetically or numerically
- Text ReverserReverse text, words or characters
- Find & ReplaceFind and replace text with options
- Text DiffCompare two texts and highlight differences
- Slug GeneratorTurn any text into a URL-friendly slug
- Text to ListConvert text into a formatted list
- Percentage CalculatorCalculate percentages instantly
- Percentage Change CalculatorMeasure increase or decrease between values
- Discount CalculatorFind sale price & savings
- Tax CalculatorAdd or remove sales tax & VAT
- Tip CalculatorCalculate tips & gratuity
- Split Bill CalculatorSplit a bill & tip across people
- Ratio CalculatorSimplify & solve ratios
- Fraction CalculatorAdd, subtract, multiply & divide fractions
- Average CalculatorMean, median, mode & range
- Standard Deviation CalculatorVariance & standard deviation of a data set
- Age CalculatorCalculate age from any birthdate
- Date Difference CalculatorAdd to dates or find date differences
- Time Duration CalculatorCalculate time between two times
- Interest CalculatorSimple & compound interest in one tool
- Loan/EMI CalculatorMonthly EMI, interest & total payable
- Unit ConverterConvert length, weight & temperature
- Time ConverterConvert between time units
- Data Storage ConverterConvert bits, bytes, KB, MB, GB & TB
- Data Transfer ConverterConvert bit/s, Mbit/s, MB/s & GB/s
- Pressure ConverterConvert pascal, bar, psi & atm
- Energy ConverterConvert joules, calories, kWh & BTU
- Number/Base ConverterConvert binary, octal, decimal & hex
- Time Zone ConverterConvert times between world time zones
- Power ConverterConvert watts, kilowatts, horsepower & BTU/h
- Fuel Economy ConverterConvert MPG, L/100km & km/L
- Password GeneratorCreate strong, secure random passwords
- QR Code GeneratorTurn any link or text into a QR code
- Random Number GeneratorGenerate random numbers in any range
- Lorem Ipsum GeneratorGenerate placeholder Lorem Ipsum text