Online HTML minifiers

 I started by using an online HTML minifier at:


    toptal.com/developers/html-minifier


This minifier squashes up spaces and removes unnecessary quotes around attribute names. However, this minifier gives an error with my 'tips' page which is quite long with lots of HTML elements.


The online minifier ranked highest by Google removes whitespace that is significant and thus changes the layout of my page. This minifier is at:


      codebeautify.org/minify-html


One way other minifiers give smaller output is by changing HTML entities to single UTF-8 characters. These characters appeared as weird characters until I saved the minified HTML with 'Notepad' with 'Save as' with the 'encoding' as 'UTF-8'.


I then tried the minifier at:


    10015.io/tools/html-minifier


I noticed that this minifier also leaves out closing '</p>' tags for paragraphs. This causes my 15-year old browser to incorrectly show spacing between lines. However, this works fine on modern browsers. It seems closing tags are not needed for many tags, but screen readers may get confused and Google may rank the page less highly.


I found that this minifier gives an error with my long 'tips' page saying the HTML is not valid. But the 'w3.org' HTML validator does not find any errors on my 'tips' page.  So I changed to using the minifier at:


    jsonformatter.org/minify-html


This minifier gives a similar reduction in size as the minifier at '10015.io'.


Using an online HTML minifier adds another step to minifying a web page. I have to go to a public library to use an online minifier as I do not have Internet access at home. My Linux system is also a bit old to run a minifier at home.





Comments

Popular posts from this blog

Running minifiers twice

Minifying CSS

Violating Flickr's terms of service