Strip comments and unnecessary whitespace from HTML or CSS to shrink file size.
Quick Answer
HTML & CSS Minifier lets you: Strip comments and unnecessary whitespace from HTML or CSS to shrink file size. To start, select which type of code you want to minify.
Select which type of code you want to minify.
Paste your HTML or CSS into the editor.
Click Minify, then copy the compressed result — see how much size you saved.
HTML input
Minified output
<!DOCTYPE html><html><head><title>Demo</title></head><body><p>Hello world</p><pre> keep this spacing </pre></body></html>