A HyperText Markup Language (HTML) compressor is a computer application that deletes unneeded characters from an HTML code file. This type of program is also known as a "minifier," since it reduces the code to the minimum possible size. An HTML compressor strips irrelevant areas of the code, but still allows the program to function as it was intended. The primary purpose of an HTML minifier is to shrink the size of Internet files to increase the speed of a website.
Worldwide, HTML code is one of the most widely used programming languages for websites. Web browsers use HTML code to determine the content and layout of a page. Organizations such as the World Wide Web Consortium (W3C) have published guidelines for the recommended structure of an HTML file. Despite these guidelines, there are a variety of approaches that a website programmer can use when coding a page. In many cases, the code is "over written" and is more lengthy than necessary.
An HTML compressor analyzes the content of a code file and removes redundant elements. Non-essential comments placed by programmers, for instance, are automatically removed. Spaces between elements and lines of the code are also deleted. These "white space" areas allow human programmers to easily interpret the code, but are unnecessary for HTML browsers.
In addition to removing unnecessary comments and spaces in a file, an HTML compressor can also delete other irrelevant programming expressions. Many HTML programs include a closing "tag" that indicates the end of a paragraph or other layout area. While these closing tags are logical, modern browsers do not require them. Some varieties of HTML compressor will minimize the code by locating and removing these tags.
A compressor can also modify lengthy code components, and abbreviate them when possible. Some of the code used in a web page can be written in either a long or short format. For instance, the HTML code "< strike >" will cause an area of text to have a crossed-out style. An HTML compressor can replace these elements with the shortened term "< s >," which accomplishes the same task.
It is not uncommon for an HTML web page to contain hundreds or even thousands of code lines. By eliminating every redundant area, a compressor can dramatically reduce the size of the entire file. This can significantly increase the overall speed and efficiency of a website, and minimize the data bandwidth necessary to load each page.