Check the markup (HTML, XHTML, ) of Web documents
— David Dorward, Validators mailing-list.
Help me! I clicked on an icon and ended up on this strange site!
Is validation some kind of quality control? Does valid mean quality approved by W3C?
Is validity the same thing as conformance?
What is the Markup Validator and what does it do?
Who owns/maintain the Markup Validator?
How do I send feedback/bug reports about the Markup Validator?
What is (are) this (these) error message(s)?
I dont want error messages, I want you to clean up my page!
My document is valid, can I use your valid icon?
Is there a list of all available icons somewhere?
Why do I see warnings about insecure items when viewing my page after including the icon?
License and Guidelines for usage of the valid icons
Can I modify the existing icons to create my own?
I saw the valid icon displayed on a site but the page is invalid. What should I do?
Miscellaneous (Very) Frequently Asked Questions
How can I include flash in valid (X)HTML Web pages?
The validator complains about & in my URLs!
Why doesnt the validator like my link … / or meta … /?
I found some nasty typo like pa … and the validator accepted it!
/check?uri=referer does not workor the validator says it does not support myundefined URL scheme
Can the validator check all the pages in my site in one batch?
Help me! I clicked on an icon and ended up on this strange site!
The author of the Web page you come from once used our service tovalidatethat page, and the page passed validation. The author was then authorized to use the icon on that page, as a claim ofvalidity. The icon is used as a link back to the validation service, so that the author canrevalidatewhenever necessary. This is why, by clicking on the icon, you followed a link to the currentvalidation resultsfor the page you came from.
The validation result was certainly positive (this page is valid…), but if it wasnt, you would probably do the author of the page where the icon was a favor if you could warn him/her of this abnormal situation.
If you are curious about Markup validation you may read this help document further, or you may simply use the back button of your Web browser to come back to the page where you found the valid icon.
Most pages on the World Wide Web are written in computer languages (such asHTML) that allow Web authors to structure text, add multimedia content, and specify what appearance, or style, the result should have.
As for every language, these have their owngrammar,vocabularyandsyntax, and every document written with these computer languages are supposed to follow these rules. The (X)HTML languages, for all versions up to XHTML 1.1, are using machine-readable grammars calledDTDs, a mechanism inherited fromSGML.
However, Just as texts in a natural language can include spelling or grammar errors, documents using Markup languages may (for various reasons) not be following these rules. The process of verifying whether a document actually follows the rules for the language(s) it uses is calledvalidation, and the tool used for that is a validator. A document that passes this process with success is calledvalid.
With these concepts in mind, we can define markup validation as the process of checking a Web document against the grammar (generally a DTD) it claims to be using.
Validity is one of the quality criteria for a Web page, but there are many others. In other words, avalidWeb page is not necessarily a good web page, but aninvalidWeb page has little chance of being a good web page.
For that reason, the fact that the W3C Markup Validator says that one page passes validation doesnotmean that W3C assesses that it is a good page. It only means that a tool (not necessarily without flaws) has found the page to comply with a specific set of rules. No more, no less. This is also why the valid … icons should never be considered as a W3C seal of quality.
Markup languages are defined intechnical specifications, which generally include aformal grammar. A document is valid when it is correctly written in accordance to the formal grammar, whereas conformance relates to the specification itself. The twomightbe equivalent, but in most cases, some conformance requirements cannot be expressed in the grammar, making validity only a part of the conformance.
The Markup Validator is a free tool and service thatvalidates markup: in other words, it checks the syntax of Web documents, written in formats such as (X)HTML.
The Validator is sort of likelintfor C. It compares your HTML document to the defined syntax of HTML and reports any discrepancies.
Learn moreabout the Markup Validator and the languages it can validate.
One of the important maxims of computer programming is:Be conservative in what you produce; be liberal in what you accept.
Browsers follow the second half of this maxim by accepting Web pages and trying to display them even if theyre not legal HTML. Usually this means that the browser will try to make educated guesses about what you probably meant. The problem is that different browsers (or even different versions of the same browser) will make different guesses about the same illegal construct; worse, if your HTML isreallypathological, the browser could get hopelessly confused and produce a mangled mess, or even crash.
Thats why you want to follow the first half of the maxim by making sure your pages are legal HTML. The best way to do that is by running your documents through one or more HTML validators.
Alengthier answerto this question is also available on this site if the explanation above did not satisfy you.
The Markup Validator is maintained atW3Cby W3C staff and benevolent collaborators, who receive a lot of help from contributors (read thefull credits).
Were doing our best to provide clear and reliable results as well as a good interface with the Markup Validator, but for some reason you may want to check other validators. Here are a few choices:
Looking for validators at W3C, but not the Markup Validator? Check out the list ofvalidators at W3C, including well-knownCSS validatorlink checker, etc.
The Validator is based onOpenSP, an SGML parser based onJames ClarkSPSGML parser. The Validator itself is a CGI script that (basically) fetches your document, passes it through the parser, and post-processes the resulting error list for easier reading.
Read the instructions on ourFeedback page.
Most probably, you will want to use the online Markup Validation service. The simple way to use this service to validate a Web page is to paste its address into thetext areaon thevalidators home page, and press the Check button.
There are other possible uses and a few usage options, please read theusers manualfor further help with this service.
If, for some reason, you prefer running your own instance of the Markup Validator, check out ourdevelopers documentation.
The output of the Markup Validator may be hard to decipher for newcomers and experts alike, so we are maintaining alist of error messages and their interpretation, which should help.
Dont panic. Did The Validator complain about yourDOCTYPEdeclaration (or lack thereof)? Make sure your document has a syntactically correctDOCTYPEdeclaration, as described in thesection onDOCTYPE, and make sure it correctly identifies the type of HTML youre using. Then run it through The Validator again; if youre lucky, you should get a lot fewer errors.
If this doesnt help, then you may be experiencing a cascade failure one error that gets The Validator so confused that it cant 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.
Have a look at tools such asHTML Tidyandtidyp. When selected, the Clean up Markup with HTML-Tidy option will output a cleaned version of the input document in case it was not valid, done withHTML-Tidy, using the Markup Validators default HTML-Tidy configuration. Note that there are no guarantees about the validity or other aspects of that output, and there are many options to configure in these tools that may result in better clean up than the Validators default options for your document, so you may want to try out them locally.
We encourage you to use the XHTML code below (or its HTML equivalent), but you may use a different code to integrate the icon within your web page as long as the icon is used as a link to revalidate the Web page it is in. Sample code is as follows:
p a href= src= alt=Valid XHTML 1.0! height=31 width=88 //a /p
Is there a list of all available icons somewhere?
Thefull list of valid iconsis available on the W3C website.
Many browsers display this warning when viewing documents transferred over a secure protocol such as HTTPS if the documents contain items that are transferred over a non-secure protocol such as unencrypted HTTP. As W3C does not currently provide the valid icons over HTTPS, you may want to copy and serve the icons from a HTTPS enabled server elsewhere and link to those copies instead of the W3C originals in your documents that are transferred over a secure protocol to avoid this warning. See also HTTPS related documentation in the/check?uri=referer FAQ entry.
Web content providers are granted the right to use the W3C valid logo on pages that pass validation (through the use of theW3C Markup Validator) for the W3C technology represented by the icon, andonlyon pages that pass validation. The icon must be used as a link to revalidate the Web page, thus providing a way to verify the page authors assertion that it passed validation.
Note that W3C Valid icons are not an endorsement by the W3C of the pages author, the substantive content of the page, nor its design. Instead, the icons areonlya mechanism to identify pages that have been determined to be valid, and to easily revalidate pages as often as as they are modified.
Consequently, the use of the badge is in accordance with and governed by the W3CTrademark LicenseandLogo and Icon usagepolicy.
No. The validators icons are distributed under the W3C document license, which allows distribution but does not allow derivative works.
We recommend that you write to the site manager and politely bring to that persons attention that there is an inconsistency. Please note that W3C does not verify or attempt to enforce validity claims.
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 typicalXHTML 1.0document:
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN html xmlns= lang=en xml:lang=en head titleTitle/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 theXHTML 1.0Recommendation.
The W3C QA Activity maintains aList of recommended Doctypesthat you can choose from, and theWDGmaintains a document onChoosing a DOCTYPE.
An HTML document should be served along with its character encoding.
Specifying a character encoding is typically done by the web server configuration, by the scripts that put together pages, and inside the document itself.IANAmaintains the list ofofficial names for character encodings(called charsets in this context). You can choose from a number of encodings, though we recommend UTF-8 as particularly useful.
The W3CI18NActivity has collected afew tips on how to do this.
To quickly check whether the document would validate after addressing the missing character encoding information, you can use the Encoding form control (accesskey 2) earlier in the page to force an encoding override to take effect. iso-8859-1 (Western Europe and North America) and utf-8 (Universal, and more commonly used in recent documents) are common encodings if you are not sure what encoding to choose.
Many Flash authoring tools recommend, or enforce, the usage of the embed element to include flash animations or applications in Web pages. embed, however, was never part of any standardized version of HTML, and this practice produces invalid markup.
There are many techniques to incorporate flash in valid web pages. One of the most famous is theFlash Sataytechnique.
Most probably, you should read theampersand sectionof WDGs excellentcommon validation problemsdocument.
Most probably, you should read thescript sectionof WDGs excellentCommon HTML Validation Problemsdocument.
HTML is based onSGMLand uses an SGML feature (called SHORTTAG) (note that this isnotthe 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 /headbody is optional in HTML (again,notin XHTML), it is silently inserted, thus head-only elements like meta and style as well as /head and body, which may appear only once, become false.
(explanation courtesy of Christoph Pper)
This again (as in theprevious case) comes from the SHORTTAG feature in HTML (notin XHTML). The typo is actually a shorthand markup and is a valid construct in HTML, even though its useis not recommended.
Browsers and other Web agents usually send information about the page they come from, in aRefererheader. The validator uses this information for a features that allows it to validate whatever page the browser last visited. The valid icons on some Web page usually point to the validation of the page using this feature.
Unfortunately, some zealous security software or Web proxies strip the referrer information from what the browser sends. Without this information the validator is not able to find what the URL of the document to validate is, and gives the same error message as when it is given a type of URL it does not understand.
Also, requests to non-secure HTTP resources from links in documents transferred with a secure protocol such as HTTPS should not include referrer informationper the HTTP/1.1 specification. As the validator at is currently not available over HTTPS, this referrer feature will not work reliably for documents transferred over secure protocols (usuallyhttpsURLs) with it.
issue. The validator should have redirected you to
. Otherwise, check the address you have given the validator.
The validator cannot fix this issue. You will have to (ask your administrator to) reconfigure whichever zealous software is stripping this referrer info.
If you have a link on your page using the /check?uri=referer feature, you could replace them with the a link to the validator without this feature, e.g.
If you have no control over the page or annoying software, or your pages URL is a
one, simply append the address of the page you wanted validated (URI encoded) to the
This service runs the W3C Markup Validator,v1.3+hg.