Table of contents

Using this service

How do I use this service?

Most probably, you will want to use the online Markup Validation service. Read the user's manual for further help with this service.

If, for some reason, you prefer running your own instance of the Markup Validator, check out our developer's documentation.

What are these error messages?

The output of the Markup Validator may be hard to decypher for newcomers and experts alike, so we are maintaining a list of error messages and their interpretation, which should help.

Many error messages? Don't panic.

Don't panic. Did The Validator complain about your DOCTYPE declaration (or lack thereof)? Make sure your document has a syntactically correct DOCTYPE declaration, as described in the section on DOCTYPE, and make sure it correctly identifies the type of HTML you're using. Then run it through The Validator again; if you're lucky, you should get a lot fewer errors.

If this doesn't help, then you may be experiencing a cascade failure — one error that gets The Validator so confused that it can't make sense of the rest of your page. Try correcting the first few errors and running your page through The Validator again.

Be patient, with a little time and experience you will learn to use the Markup Validator to clean up your HTML documents in no time.

I don't want error messages, I want you to clean up my page!

The Markup Validator can not do this for you. You may want to have a look at tools such as HTML Tidy.

Miscellaneous (Very) Frequently Asked Questions

No DOCTYPE Declaration Found!

A DOCTYPE Declaration is mandatory for most current markup languages and without one it is impossible to reliably validate a document.

One should place a DOCTYPE declaration as the very first thing in an HTML document. For example, for a typical XHTML 1.0 document:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
        <head>

          <title>Title</title>
        </head>

        <body>
          <!-- ... body of document ... -->
        </body>

      </html>
    

For XML documents, you may also wish to include an "XML Declaration" even before the DOCTYPE Declaration, but this is not well supported in older browsers. More information about this can be found in the XHTML 1.0 Recommendation.

The W3C QA Activity maintains a List of Valid Doctypes that you can choose from, and the WDG maintains a document on "Choosing a DOCTYPE".

The validator is not able to extract a character encoding

An HTML document should be served along with its character encoding.

WDG has some good documentation on using character encodings that will help you fix your document or the way it is served by adding the proper character encoding information.

The validator complains about "&" in my URLs!

Most probably, you should read the ampersand section of WDG's excellent "common validation problem"

The validator complains about something in my Javascript!

Most probably, you should read the script section of WDG's excellent "common validation problem"

Why doesn't the validator like my <link ... /> or <meta ... />?

HTML is based on SGML and uses an SGML feature (called SHORTTAG) (note that this is not the case with XHTML).

With this feature enabled, the "/" in <link ... /> or <meta ... /> already closes the link (or meta) tag, and the ">" becomes some regular text, which is not allowed in the <head> element. Since </head><body> is optional in HTML (again, not in XHTML), it is silently inserted, thus head-only elements like meta and style as well as "</head>" and "<body>", which may apear only once, become false.

(explanation courtesy of Christoph Päper)

I found some nasty typo like <p<a ...> and the validator accepted it!

This again (as in the previous case) comes from the SHORTTAG feature in HTML (not in XHTML). The typo is actually a "shorthand markup" and is a valid construct in HTML, even though its use is not recommended.