OR
Original size: 0. Minified size: 0. Savings: 0 (0.00%).
HTML Minifier Configurations
Handle attributes in a case-sensitive way, which is useful for custom HTML tags.
Remove the values from boolean attributes.
Avoid leaving spaces between inline elements when collapsing. This should be used with collapseWhitespace=true
.
Compress unnecessary whitespace that affects text nodes in the document.
Always reduce multiple spaces to a single space, but never eliminate them entirely. Should be used with collapseWhitespace=true
.
Use direct Unicode characters whenever possible instead of HTML entities.
Follow HTML5 rules when parsing the input.
Include tags automatically created by the HTML parser.
Keep the closing slash on self-closing tags like <br />
.
Set a limit for line length, and split the compressed output into multiple lines at appropriate points.
Compress CSS inside <style>
elements and style
attributes. (uses clean-css)
Compress JavaScript within <script>
tags and event attributes. (uses Terser)
Shorten URLs in various attributes, using the base URL provided. (uses relateurl)
Keep a single line break when whitespace between tags contains line breaks. Should be used with collapseWhitespace=true
.
Stop attribute values from being escaped.
Minify the content inside conditional comments.
Minify specific script types (e.g., text/ng-template
, text/x-handlebars-template
, etc.).
Choose whether to use single ('
) or double ("
) quotes for attribute values.
Remove quotes around attribute values when it’s safe to do so.
Strip out HTML comments.
Eliminate attributes that only contain whitespace.
Delete elements that have no content.
Get rid of optional tags like </body>
and </html>
.
Remove attributes when their value is the default.
Omit type="text/javascript"
from <script>
tags. Other type
attributes will remain.
Remove type="text/css"
from <style>
and <link>
tags while keeping other types.
Remove unnecessary spaces between attributes. Note that this will result in invalid HTML!
Sort attributes based on how frequently they appear.
Arrange class names by their frequency.
Remove whitespace around ignoreCustomFragments
.
Replace the doctype
declaration with the shorter HTML5 version.
About Diversify India’s HTML Minifier
Diversify India’s HTML Minifier is a free, user-friendly online tool that empowers web developers and website owners to optimize their HTML code for faster page loading and better overall performance. This HTML minifier tool compresses and cleans up HTML by removing unnecessary spaces, comments, and redundant elements without affecting your site’s display. As a result, you get a leaner codebase that helps improve website loading times, which is crucial for user experience and SEO.
Why Use Diversify India’s HTML Minifier?
With our free HTML Minifier, your website can achieve faster load times by reducing HTML size. Page speed not only improves user experience but also has a positive effect on SEO, as search engines prioritize faster sites in their rankings. Diversify India’s HTML Minifier gives you powerful customization, and by fine-tuning your configurations, you can achieve just the right balance of minification for your specific needs.
How Does Diversify India’s HTML Minifier Work?
Diversify India’s HTML Minifier uses the powerful HTML Minifier Terser library, which is a modern fork of the original Kangax HTML Minifier. Both libraries are licensed under the MIT License, ensuring a robust, open-source solution trusted by developers worldwide. Our tool works by:
- Removing Extra Spaces and Line Breaks: Reduces code length without changing functionality.
- Deleting Comments: Cleans out non-essential notes meant for developers.
- Minifying JavaScript and CSS: Compresses JavaScript and CSS code.
How to Use Our HTML Minifier
- Paste Your HTML Code: Copy and paste your raw HTML code into the tool.
- Minify: Click the minify button and watch as the tool quickly compresses your code.
- Copy the Output: Use the compressed code in your projects for optimized web pages.
Key Features of Diversify India’s HTML Minifier
- Fast and User-Friendly: Minifies your HTML in seconds, no technical expertise needed.
- Reliable and Safe: Uses well-established libraries to ensure your code remains functional and secure.
- Free and Accessible: Available online without the need for downloads or installations.