HTML Minifier | Online HTML Compression Tool



Upload (.txt, .html, .htm, .doc) File To Minify HTML


OR Paste Your Content Below




HTML Compressor Settings

Whitespace Minification Mode

Whitespace minification mode. Can take the following values:

  • None. Keep whitespace.
  • Safe. Safe whitespace minification: removes whitespace characters from top and bottom of HTML document; multiple whitespace characters are replaced by a single space; removes all leading and trailing whitespace characters from DOCTYPE declaration; removes all leading and trailing whitespace characters from outer and inner contents of invisible tags (htmlheadbodymetalinkscript, etc.); removes unnecessary leading and trailing whitespace characters from outer contents of non-independent tags (lidtddrbrtcrtrpoptiontrtdth, etc.).
  • Medium. Medium whitespace minification: executes all operations of the safe whitespace minification + removes all leading and trailing whitespace characters from outer and internal contents of block-level tags.
  • Aggressive. Aggressive whitespace minification: executes all operations of the medium whitespace minification + removes all leading and trailing whitespace characters from internal contents of inline and inline-block tags.


Remove HTML Comments

Flag for whether to remove all HTML comments, except conditional, noindex, KnockoutJS containerless comments and AngularJS 1.X comment directives.


Remove Html Comments­ From Scripts And Styles

Flag for whether to remove HTML comments from script and style tags.


Remove Cdata Sections­ From Scripts And Styles

Flag for whether to remove CDATA sections from script and style tags.


Use Short Doctype

Flag for whether to replace existing document type declaration by short declaration - <!DOCTYPE html>.


Preserve Case

Flag for whether to preserve case of tag and attribute names (useful for Angular 2 templates).


Use Meta Charset Tag

Flag for whether to replace <meta http-equiv="content-type" content="text/html; charset=…"> tag by <meta charset="…"> tag


Empty Tag Render Mode

Render mode of HTML empty tag. Can take the following values:

  • NoSlash. Without slash (for example, <br>).
  • Slash. With slash (for example, <br/>).
  • SpaceAndSlash. With space and slash (for example, <br />).


Remove Optional End Tags

Flag for whether to remove optional end tags (htmlheadbodyplidtddrbrtcrtrpoptgroupoptioncolgrouptheadtfoottbodytrth and td).


Remove Tags Without Content

Flag for whether to remove tags without content, except for textareatrth and td tags, and tags with classidnamerolesrc and custom attributes.


Collapse Boolean Attributes

Flag for whether to remove values from boolean attributes (for example, checked="checked" is transforms to checked).


Attribute Quotes Removal Mode

HTML attribute quotes removal mode. Can take the following values:

  • KeepQuotes. Keep quotes.
  • Html4. Removes a quotes in accordance with standard HTML 4.X.
  • Html5. Removes a quotes in accordance with standard HTML5.


Remove Empty Attributes

Flag for whether to remove attributes, which have empty value (valid attributes are: classidnamestyletitlelangdir, event attributes, actionattribute of form tag and value attribute of input tag).


Remove Redundant Attributes

  • <scriptlanguage="javascript" …>
  • <script src="…" charset="…"…>
  • <link rel="stylesheet"charset="…" …>
  • <form method="get" …>
  • <input type="text" …>
  • <a id="…" name="…" …>
  • <area shape="rect" …>


Remove Js Type Attributes

Flag for whether to remove type="text/javascript"attributes from script tags.


Remove Css Type Attributes

Flag for whether to remove type="text/css" attributes from style and link tags.


Remove Http Protocol­ From Attributes

Flag for whether to remove the HTTP protocol portion (http:) from URI-based attributes (tags marked with rel="external" are skipped).


Remove Https Protocol­ From Attributes

Flag for whether to remove the HTTPS protocol portion (https:) from URI-based attributes (tags marked with rel="external" are skipped).


Remove Js Protocol ­From Attributes

Flag for whether to remove the javascript: pseudo-protocol portion from event attributes.


Minify Embedded Css Code

Flag for whether to minify CSS code in style tags.


Minify Inline Css Code

Flag for whether to minify CSS code in style attributes.


Minify Embedded Js Code

Flag for whether to minify JS code in script tags.


Minify Inline Js Code

Flag for whether to minify JS code in event attributes and hyperlinks with javascript: pseudo-protocol.


Processable Script Type List

Comma-separated list of types of script tags, that are processed by minifier (e.g. "text/html, text/ng-template"). Currently only supported the KnockoutJS, Kendo UI MVVM and AngularJS 1.X views.


Minify Knockout­ Binding Expressions

Flag for whether to minify the KnockoutJS binding expressions in data-bind attributes and containerless comments.


Minify Angular­ Binding Expressions

Flag for whether to minify the AngularJS 1.X binding expressions in Mustache-style tags ({{}}) and directives.


Custom Angular Directive List

Comma-separated list of names of custom AngularJS 1.X directives (e.g. "myDir, btfCarousel"), that contain expressions. If value of the MinifyAngularBindingExpressionsproperty equal to true, then the expressions in custom directives will be minified.



Ranknotebook is providing you an efficient HTML minifier tool that provides great help to the developers in reducing the unnecessary lines and compressing the HTML code. The HTML minifies works effectively by removing the white spaces, unnecessary line breaks and characters in the HTML code.

Our online HTML compressor tool is the best working tool that one can easily access for free! One can use this minifier tool to get the best results with reduces HTML file size.

HTML removes only the irrelevant lines of codes, keeping the actual source code as it is. There are enormous ways to increase the loading speed of your web pages, and HTML minifier is one of such tools.

With this tool you can easily minify your html code for:

  1. ➲ Whitespace Minification Mode (None, Safe, Medium, Aggresive)
  2. ➲ Remove HTML Comments
  3. ➲ Remove Html Comments­ From Scripts And Styles
  4. ➲ Remove Cdata Sections­ From Scripts And Styles
  5. ➲ Use Short Doctype
  6. ➲ Preserve Case
  7. ➲ Use Meta Charset Tag
  8. ➲ Empty Tag Render Mode (No Slash, Slash, Space and Slash)
  9. ➲ Remove Optional End Tags
  10. ➲ Remove Tags Without Content
  11. ➲ Collapse Boolean Attributes
  12. ➲ Attribute Quotes Removal Mode (Keep Quotes, HTML4, HTML5)
  13. ➲ Remove Empty Attributes for class, id, name, style, title, lang, dir, form etc.
  14. ➲ Remove Redundant Attributes
  15. ➲ Remove Js Type Attributes
  16. ➲ Remove Css Type Attributes
  17. ➲ Remove Http Protocol­ From Attributes
  18. ➲ Remove Https Protocol­ From Attributes
  19. ➲ Remove Js Protocol ­From Attributes
  20. ➲ Minify Embedded Css Code
  21. ➲ Minify Inline Css Code
  22. ➲ Minify Embedded Js Code
  23. ➲ Minify Inline Js Code
  24. ➲ Processable Script Type List
  25. ➲ Minify Knockout­ Binding Expressions
  26. ➲ Minify Angular­ Binding Expressions
  27. ➲ Custom Angular Directive List

Why to minify your HTML code?

Minifying your HTML code will increase the reach at your website. It will get load faster through compressing the file size. It also makes your code, difficult to copy from any source. It removes out all the unnecessary characters from the code. This HTML minifier can provide you a great help for the Search Engine Optimization, since it increases the loading capacity of your webpages.

How to use our HTML Minifier Tool?

Ranknotebook aims to provide you an efficient and easily tool that gives you quick results. Anyone can use this tool, to minimize the given lines of code even when the person is not having adequate programming knowledge. The tool uses the algorithm to process the output. It removes out the unnecessary functions and variables from a given piece of code.

With this tool you can easily minify or compress your html code online for:

Whitespace Minification Mode (None, Safe, Medium, Aggressive): -

It deals with the whitespace, based on the type one has chosen.

None Keep all the whitespace

Safe It removes the whitespaces from top and bottom of the code, along with the replacing of multiple whitespaces with a single one.

Medium Removes all whitespaces from outer and internal part of code.

Aggressive Removes all the required whitespaces.

  1. Remove HTML Comments- Removes all uncessary HTML comments. Takes the Boolean values as input options and accordingly display the results.
  2. Remove Html Comments¬ from Scripts And Styles: - take Boolean values for whether to remove whitespaces from script or not.
  3. Remove Cdata Sections¬ From Scripts And Styles
  4. Use Short Doctype: - Whether to replace the existing doc type declaration with short declaration.
  5. Preserve Case
  6. Use Meta Charset Tag
  7. Empty Tag Render Mode (No Slash, Slash, Space and Slash)
  8. Remove Optional End Tags
  9. Remove Tags Without Content
  10. Collapse Boolean Attributes
  11. Attribute Quotes Removal Mode (Keep Quotes, HTML4, HTML5)
  12. Remove Empty Attributes for class, id, name, style, title, lang, dir, form etc.
  13. Remove Redundant Attributes
  14. Remove Js Type Attributes
  15. Remove Css Type Attributes
  16. Remove Http Protocol From Attributes
  17. Remove Https Protocol From Attributes
  18. Remove Js Protocol From Attributes
  19. Minify Embedded CSS Code
  20. Minify Inline CSS Code
  21. Minify Embedded Js Code
  22. Minify Inline Js Code

minify html, html compressor, html compressor online, html compressor online, online html minifier, html compression tool, minify html code, compress html file, compress html code

Subscribe to Newsletter

and receive updates in your inbox