As HTML invades the world wide web, more and more HTML pages are being written. And, almost all published websites online do not comply with W3 standards. Several factors cause HTML invalidity, some of which are: incorrect placement of tags, invalid attributes for tags, misspelled tags… Invalid HTML leads to issues such as: a decrease in loading DOM content, decrease in page performance, incorrect display of content, and many others. To minimize these errors, we propose an algorithm for HTML spelling correction, and an enhancement to missing tag correction. We believe that this would highly minimize the errors in HTML pages, increase DOM content load time, and improve the performance of web pages especially on devices with limited resources such as mobile devices.