Validate HTML Code - HTML Code Validators

What HTML Code Validators Do

HTML (Hyper Text Markup Language) code validators check that the web page HTML coding is in compliance with HTML standards set by the W3C.

If your web pages don't validate chances are they won't render properly in all the browsers. Use one of the many HTML code validators available to validate HTML code for each web page in the website. If the web page HTML code is correct it doesn't take much time to validate HTML code.

HTML Code Validators Available

There are various HTML code validators available on the net. I use and recommend the W3C's free HTML validation services to validate HTML code. There are 3 choices, you can validate HTML code by using the url of the page, validate HTML code by using uploading from your computer or by entering HTML code into the interface.

Note:  The upload from your computer service will not work if you use Internet Explorer and have XP SP2 installed. After XP SP2 Internet Explorer sends the page in a format that the HTML code validator does not understand. This is a Internet Explorer problem not a problem with the HTML code validator. See the W3C Question and Answer page for ideas how to resolve this issue. If you use another browser it will work fine.

Something you have to understand is, programs take time to write and update. Other HTML code validators online and downloadable programs may not be testing for the latest standard. The W3C group wrote the standards and created the validators available through their site and why I reccommend using their services to validate HTML code.

Using the W3C's Validation Services

To use the W3C's validation services to validate HTML code the DOCTYPE declaration is required. This goes at the very top of your HTML coding. To learn more about where the DOCTYPE declaration goes, see our HTML Document Structure article. The DOCTYPE declaration sets what HTML specification standard the document is coded for so the browsers and validators know how to process HTML code.

Leave the following items at their default:

In each of the versions click the following boxes:

Next, click the Check button.

If the web page uses valid HTML coding for the DOCTYPE declaration specified the HTML validator results will say "This Page Is Valid XXXXX!" (XXXXX will be name of HTML standard the HTML validator tested for).

You will notice that some websites have an image that looks like (or similar to) this:

Valid XHTML 1.0!

This sample image indicates that the page uses valid XHTML 1.0 code.

Once your pages validate you can also add the appropriate image to the page. The instructions will appear on HTML validator results page for inserting the image. The guidelines for image use are available at My document is valid, can I use your valid icon?

My Page Won't Validate!

If you see the message "This page is not Valid XXXXX!" (XXXXX will be the name of HTML standard it was tested for) then the HTML validator found that there are HTML coding errors.

Look below this message and there will be a list of errors contained in the page and a link to the line containing HTML code error.

Fix one error at a time. Sometimes fixing one error will correct a whole pile of other errors. This is because the parser gets confused when you do not code correctly. Validate HTML code each time a correction is made.

Sometimes the line indicated does not contain an error. This is because somewhere above this line there is HTML code error(s) and the HTML validator has become confused. Look at your HTML code above this line one line at a time to find the error.

"Fatal Error: No DOCTYPE specified!"

You forgot to add the DOCTYPE declaration at the top of your HTML coding or you did not type it correctly, try retyping it.

Related Code Validators

If you found this web page a useful resource for your own website please link as follows:

HTML Basic Tutor -

Learn to validate HTML code. How to use HTML validators. Produce HTML coding that contains compliant HTML code using a HTML validator.