The primary objective of our research was to design an efficient way of compressing HTML documents, which will reduce Internet's traffic or will reduce storage requirements of HTML data. In our work we present the lossless HTML transform (LHT) aiming to improve lossless HTML compression in combination with existing general purpose compressors. The main components of our algorithm are: a static dictionary or a semi-static dictionary of frequent alphanumerical phrases, and binary encoding of popular patterns, like numbers, dates or IP addresses. Alphanumerical phrases are not limited to "words" in a conventional sense as they can be XML tags, XML entities, URL addresses, e-mails, and runs of spaces. We have developed two versions of LHT: static and semi-static. Both algorithms have some disadvantages. Static LHT uses a fixed English dictionary required for compression and decompression. Semi-static LHT does not support streams as input (offline compression) as it requires two passes over an input file. Semi-static LHT creates a dictionary in a first pass and stores it within the compressed file.