Validate an HTML document

December 2016




HTML is a standard published by the W3C with relatively strict syntax rules. This standard is important as it allows to maximize the chances for optimal viewing on almost all browsers and also ensure a certain continuity in time. Using an HTML or XHTML valid permits, when developed, rapidly detect errors in syntax, tags not closed, etc.


HTML Validator


The only reliable tool to check the syntax of your code is the HTML Validation Service from W3C accessible here

To make use this service, there are 3 methods:
  • Validate by URL
    • Enter the URL of the page to be check out.
    • Click on the Check button
  • Validate by File Upload:
    • You can upload the file containing the HTML coding.
    • Click on the Check button
  • Validate by direct input.
    • Directly copy the HTML code to validate in the field provided.
    • Click on the Check button



Across the options, it is possible to specify the type of document, and view the source code. The latter option is particularly useful to know where the error to be corrected.

During the correction, "start from the beginning" and think about regularly revalidate the document because some mistakes in others, and hide on the other hand some errors cause false positives.

Other Validators


Note that there are equivalents of this tool for other web standards:



For more information about the various tools, allowing you to achieve your purposes: http://www.sitepoint.com/...

Thanks to Jeff for this tip.

Related :

This document entitled « Validate an HTML document » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.