Choose Files:

Compression Settings:

  • Treat attributes in case sensitive manner (useful for custom HTML tags)
  • Omit attribute values from boolean attributes
  • Don't leave any spaces between display:inline; elements when collapsing. Must be used in conjunction with collapseWhitespace=true
  • Collapse white space that contributes to text nodes in a document tree
  • Always collapse to 1 space (never remove it entirely). Must be used in conjunction with collapseWhitespace=true
  • Use direct Unicode characters whenever possible
  • Parse input according to HTML5 specifications
  • Insert tags generated by HTML parser
  • Keep the trailing slash on singleton elements
  • Specify a maximum line length. Compressed output will be split by newlines at valid HTML split-points
  • Minify CSS in style elements and style attributes (uses clean-css)
  • Minify JavaScript in script elements and event attributes (uses UglifyJS)
  • Minify URLs in various attributes (uses relateurl)
  • Always collapse to 1 line break (never remove it entirely) when whitespace between tags include a line break. Must be used in conjunction with collapseWhitespace=true
  • Prevents the escaping of the values of attributes
  • Process contents of conditional comments through minifier
  • Comma-delimited string corresponding to types of script elements to process through minifier (e.g. text/ng-template, text/x-handlebars-template)
  • Type of quote to use for attribute values (' or ")
  • Remove quotes around attributes when possible
  • Strip HTML comments
  • Remove all attributes with whitespace-only values
  • Remove all elements with empty contents
  • Remove attributes when value matches default.
  • Remove type="text/javascript" from script tags. Other type attribute values are left intact
  • Remove type="text/css" from style and link tags. Other type attribute values are left intact
  • Remove space between attributes whenever possible. Note that this will result in invalid HTML!
  • Sort attributes by frequency
  • Sort style classes by frequency
  • Trim white space around ignoreCustomFragments.
  • Replaces the doctype with the short (HTML5) doctype
Select: All, None, Reset

How to compress HTML files:

  1. Settings

    Set HTML compression options first.

  2. Minify HTML

    Paste your HTML content to the textarea on the top and click "Minify" button.

  3. Compress Files

    The compressed HTML content will be shown in the textarea blow "Minify" button. Right-click on the textarea and click "Select All" to select all content. You can compress multiple HTML files in batch mode in index page.

About:

Use this HTML compressor to minify HTML source codes to reduce file size, get lower download times and save website bandwidth.

Hypertext Markup Language (HTML) is the standard markup language for creating web pages and web applications. With Cascading Style Sheets (CSS) and JavaScript, it forms a triad of cornerstone technologies for the World Wide Web.

HTML elements are the building blocks of HTML pages. With HTML constructs, images and other objects such as interactive forms may be embedded into the rendered page. HTML provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. HTML elements are delineated by tags, written using angle brackets. Tags such as <img /> and <input /> directly introduce content into the page. Other tags such as <p> surround and provide information about document text and may include other tags as sub-elements. Browsers do not display the HTML tags, but use them to interpret the content of the page.