CINXE.COM
Help for The W3C Markup Validation Service
<!doctype html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Help for The W3C Markup Validation Service</title> <link rel="help" href="mailto:www-validator@w3.org"> <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon"> <link rel="start" href="../" title="Home Page"> <link rel="stylesheet" href="../style/base" type="text/css" media="all"> <meta name="keywords" content="HTML, HyperText Markup Language, Validation, W3C Markup Validation Service"> <meta name="description" content="W3C's easy-to-use markup validation service, based on SGML and XML parsers."> </head> <body> <div id="banner"> <h1 id="title"> <a href="https://www.w3.org/"> <img alt="W3C Logo" width="110" height="61" id="logo" src="../images/w3c.png" /> </a> <a href="../"><span>Markup Validation Service</span></a> </h1> <p id="tagline">Check the markup (HTML, XHTML, …) of Web documents</p> </div> <div class="doc"> <h2>Help and <abbr title="Frequently Asked Questions">FAQ</abbr> for the Markup Validator</h2> <p><q cite="http://lists.w3.org/Archives/Public/www-validator/2004Jan/0101.html">Nothing wrong with the validator here, it just knows HTML better than you do.</q> -- David Dorward, Validator's mailing-list.</p> <h3 id="TableOfContents">Table of contents</h3> <div id="toc"> <ol> <li>About the Markup Validator <ol> <li> <a href="#clickedandlost">Help me! I clicked on an icon and ended up on this strange site!</a> </li> <li> <a href="#validation_basics">What is <em>Markup Validation</em>?</a> </li> <li> <a href="#validandquality">Is validation some kind of quality control? Does "valid" mean "quality approved by W3C"?</a> </li> <li> <a href="#validandconform">Is validity the same thing as conformance?</a> </li> <li> <strong><a href="#what-is-it">What is the Markup Validator and what does it do?</a></strong> </li> <li> <a href="#why-validate">Why validate?</a> </li> <li> <a href="#who-does-validator">Who owns/maintain the Markup Validator?</a> </li> <li> <a href="#others">What other validators are there?</a> </li> <li> <a href="#howto-feedback">How do I send feedback/bug reports about the Markup Validator?</a> </li> </ol> </li> <li>Using this service <ol> <li> <strong><a href="#manual">How do I use the Markup validator?</a></strong> </li> <li> <a href="#errors">What is (are) this (these) error message(s)?</a> </li> <li> <a href="#munged-doctype">Many error messages? Don't panic.</a> </li> <li> <a href="#cleanup">I don't want error messages, I want you to clean up my page!</a> </li> </ol> </li> <li>Miscellaneous (Very) Frequently Asked Questions <ol> <li> <a href="#faq-doctype"><q>No DOCTYPE Declaration Found!</q></a> </li> <li> <a href="#faq-charset"><q>No Character Encoding Found!</q></a> </li> <li> <a href="#faq-referer">/check?uri=referer does not work</a> or the validator says it does not support my <a href="#faq-referer">"undefined" URL scheme</a> </li> <li><a href="#faq-batchvalidation">Can the validator check all the pages in my site in one batch?</a></li> </ol> </li> </ol> </div> <div><a id="skip" name="skip"></a> <h3 id="about">About the Markup Validator</h3> <h4 id="clickedandlost">Help me! I clicked on an icon and ended up on this strange site!</h4> <p>Don't panic!</p> <p> The author of the Web page you come from once used our service to <em>validate</em> that page, and the page passed validation. The author was then authorized to use the icon on that page, as a claim of <em>validity</em>. The icon is used as a link back to the validation service, so that the author can <em>revalidate</em> whenever necessary. This is why, by clicking on the icon, you followed a link to the current <em>validation results</em> for the page you came from. </p> <p> The validation result was certainly positive ("this page is valid..."), but if it wasn't, 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. </p> <p> 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. </p> <h4 id="validation_basics">What is <em>Markup Validation</em>?</h4> <p>Most pages on the World Wide Web are written in computer languages (such as <abbr title="HyperText Markup Language">HTML</abbr>) that allow Web authors to structure text, add multimedia content, and specify what appearance, or style, the result should have.</p> <p>As for every language, these have their own <em>grammar</em>, <em>vocabulary</em> and <em>syntax</em>, 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 called <abbr title="Document Type Definition">DTD</abbr>s, a mechanism inherited from <a href="sgml.html"><abbr title="Standard Generalized Markup Language">SGML</abbr></a>. </p> <p> 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 called <em>validation</em>, and the tool used for that is a validator. A document that passes this process with success is called <em>valid</em>. </p> <p>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.</p> <h4 id="validandquality">Is validation some kind of quality control? Does "valid" mean "quality approved by W3C"?</h4> <p>Validity is one of the quality criteria for a Web page, but there are many others. In other words, a <em>valid</em> Web page is not necessarily a good web page, but an <em>invalid</em> Web page has little chance of being a good web page.</p> <p>For that reason, the fact that the W3C Markup Validator says that one page passes validation does <strong>not</strong> mean 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".</p> <h4 id="validandconform">Is validity the same thing as conformance?</h4> <p> No, they are different concepts. </p> <p> Markup languages are defined in <em>technical specifications</em>, which generally include a <em>formal grammar</em>. A document is valid when it is correctly written in accordance to the formal grammar, whereas conformance relates to the specification itself. The two <em>might</em> be equivalent, but in most cases, some conformance requirements cannot be expressed in the grammar, making validity only a part of the conformance. </p> <h4 id="what-is-it">What is the Markup Validator and what does it do?</h4> <p> The Markup Validator is a free tool and service that <a href="#validation_basics">validates markup</a>: in other words, it checks the syntax of Web documents, written in formats such as (X)HTML. </p> <p> The Validator is sort of like <code>lint</code> for C. It compares your HTML document to the defined syntax of HTML and reports any discrepancies. </p> <p><a href="../about.html">Learn more</a> about the Markup Validator and the languages it can validate.</p> <h4 id="why-validate">Why should I validate my HTML pages?</h4> <p> One of the important maxims of computer programming is: <q>Be conservative in what you produce; be liberal in what you accept.</q> </p> <p> Browsers follow the second half of this maxim by accepting Web pages and trying to display them even if they're 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 is <em>really</em> pathological, the browser could get hopelessly confused and produce a mangled mess, or even crash. </p> <p> That's 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. </p> <p>A <a href="why.html">lengthier answer</a> to this question is also available on this site if the explanation above did not satisfy you. </p> <h4 id="who-does-validator">Who owns/maintain the Markup Validator?</h4> <p>The Markup Validator is maintained at <abbr title="World Wide Web Consortium">W3C</abbr> by W3C staff and benevolent collaborators, who receive a lot of help from contributors (read the <a href="../about.html#credits">full credits</a>). </p> <h4 id="others">What other validators are there?</h4> <p> Looking for validators at W3C, but not the Markup Validator? Check out the list of <a href="http://www.w3.org/QA/Tools/#validators">validators at W3C</a>, including well-known <a href="http://jigsaw.w3.org/css-validator/">CSS validator</a>, <a href="https://validator.w3.org/checklink">link checker</a>, etc. </p> <h4 id="howto-feedback">How do I send feedback/bug reports about the Markup Validator?</h4> <p>Read the instructions on our <a href="../feedback.html">Feedback page</a>.</p> </div> <div> <h3 id="using">Using this service</h3> <h4 id="manual">How do I use this service?</h4> <p>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 the <a href="../#uri">text area</a> on the <a href="..">validator's home page</a>, and press the "Check" button.</p> <p>There are other possible uses and a few usage options, please read the <a href="users.html">user's manual</a> for further help with this service. </p> <p> If, for some reason, you prefer running your own instance of the Markup Validator, check out our <a href="devel.html">developer's documentation</a>. </p> <h4 id="errors">What are these error messages?</h4> <p>The output of the Markup Validator may be hard to decipher for newcomers and experts alike, so we are maintaining a <a href="errors.html">list of error messages and their interpretation</a>, which should help. </p> <h4 id="munged-doctype">Many error messages? Don't panic.</h4> <p> Don't panic. Did The Validator complain about your <code>DOCTYPE</code> declaration (or lack thereof)? Make sure your document has a syntactically correct <code>DOCTYPE</code> declaration, as described in the <a href="sgml.html#doctype">section on <code>DOCTYPE</code></a>, 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. </p> <p> 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. </p> <p> 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. </p> <h4 id="cleanup">I don't want error messages, I want you to clean up my page!</h4> <p> Have a look at tools such as <a href="http://tidy.sourceforge.net/">HTML Tidy</a> and <a href="http://www.tidyp.com/">tidyp</a>. 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 with <a href="http://search.cpan.org/dist/HTML-Tidy/">HTML-Tidy</a>, using the Markup Validator's 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 Validator's default options for your document, so you may want to try out them locally. </p> </div> <div> <h3 id="very-faq">Miscellaneous (Very) Frequently Asked Questions</h3> <h4 id="faq-doctype">No DOCTYPE Declaration Found!</h4> <p> A DOCTYPE Declaration is mandatory for HTML documents. </p> <p>Unless you have very specific needs, you should use the following generic DOCTYPE: <code><!DOCTYPE html></code>. A typical HTML document looks like: </p> <pre> <!DOCTYPE html> <html lang="en"> <head> <title>Title</title> </head> <body> <!-- ... body of document ... --> </body> </html> </pre> <h4 id="faq-charset"><q>No Character Encoding Found! </q></h4> <p>An HTML document should be served along with its character encoding.</p> <p>Specifying a character encoding is typically done by the web server configuration, by the scripts that put together pages, and inside the document itself. <a href="http://www.iana.org/"><abbr title="Internet Assigned Numbers Authority">IANA</abbr></a> maintains the list of <a href="http://www.iana.org/assignments/character-sets">official names for character encodings</a> (called charsets in this context). You can choose from a number of encodings, though we recommend UTF-8 as particularly useful.</p> <p>The W3C <abbr title="Internationalization">I18N</abbr> Activity has collected a <a href="http://www.w3.org/International/O-charset">few tips on how to do this</a>.</p> <p> 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. </p> <h4 id="faq-referer">/check?uri=referer does not work - or - the validator says it does not support my "undefined" URL scheme</h4> <p>Browsers and other Web agents usually send information about the page they come from, in a <code>Referer</code> header. 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.</p> <p>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.</p> <p> Also, requests to non-secure HTTP resources from links in documents transferred with a secure protocol such as HTTPS should not include referrer information <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec15.html#sec15.1.3">per the HTTP/1.1 specification</a>. As the validator at validator.w3.org is currently not available over HTTPS, this referrer feature will not work reliably for documents transferred over secure protocols (usually <code>https</code> URLs) with it. </p> <p><strong>How to fix</strong>:</p> <ul> <li>Check that it is indeed the <code>Referer</code> issue. The validator should have redirected you to <code>https://validator.w3.org/check?uri=<em>your_url_here</em></code>. Otherwise, check the address you have given the validator.</li> <li>The validator cannot fix this issue. You will have to (ask your administrator to) reconfigure whichever zealous software is stripping this referrer info.</li> <li>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. <code>https://validator.w3.org/check?uri=http%3A%2F%2Fwww.example.com</code></li> <li>If you have no control over the page or annoying software, or your page's URL is a <code>https</code> one, simply append the address of the page you wanted validated (URI encoded) to the <code>https://validator.w3.org/check?uri=</code> address.</li> </ul> </div> </div> <ul class="navbar" id="menu"> <li><a href="/" accesskey="1" title="Go to the Home Page for The W3C Markup Validation Service">Home</a><span> | </span></li> <li><a href="/about.html" title="Information About this Service">About...</a><span> | </span></li> <li><a href="/whatsnew.html" title="The changes made to this service recently">News</a><span> | </span></li> <li><a href="/docs/" accesskey="3" title="Documentation for this Service">Docs</a><span> | </span></li> <li><a href="/docs/help.html" title="Help and answers to frequently asked questions">Help & <abbr title="Frequently Asked Questions">FAQ</abbr></a><span> | </span></li> <li><a href="/feedback.html" accesskey="4" title="How to provide feedback on this service">Feedback</a><span> | </span></li> <li><a href="/contribute.html" title="How to contribute to the validator project">Contribute</a><span> | </span></li> </ul> <div id="footer"> <p id="activity_logos"> <a href="https://www.w3.org/Status" title="W3C's Open Source, bringing you free Web quality tools and more"><img src="https://www.w3.org/assets/logos/w3c/w3c-no-bars.svg" alt="W3C" width="72" height="47"><img src="./images/opensource-55x48.png" alt="Open-Source" title="We are building certified Open Source/Free Software. - see www.opensource.org" width="55" height="48"></a> </p> <p id="support_logo"> <a href="https://www.w3.org/donate/"> <img src="https://www.w3.org/QA/Tools/I_heart_validator" alt="I heart Validator logo" title="Donate to W3C" width="80" height="15"> </a> </p> <p class="copyright"><span lang="en" dir="ltr">Copyright © 2024 <a href="https://www.w3.org/">World Wide Web Consortium</a>. <abbr title="World Wide Web Consortium">W3C</abbr><sup>®</sup> <a href="https://www.w3.org/policies/#disclaimers">liability</a>, <a href="https://www.w3.org/policies/#trademarks">trademark</a> and <a rel="license" href="https://www.w3.org/copyright/document-license/" title="W3C Document License">permissive license</a> rules apply.</span></p> </div><!-- footer --> <script src="https://www.w3.org/QA/Tools/w3c-include.js"></script> </body> </html>