Help:Markup validation

The W3C Markup Validation Service lets editors check web pages for conformance to HTML and XHTML standards. It is helpful for catching minor problems such as duplicate section names or citation IDs. Although most major browsers will tolerate many of the errors, and will display a document successfully even if it contains errors, they may misbehave on documents that contain the errors: for example, they may go to the wrong section or citation if you click the mouse on a wikilink. Checking that a page contains valid HTML can thus fix these minor glitches while also increasing portability to unusual browsers.

To check the HTML for a Wikipedia article XYZ, visit the service's home page and enter the text "".

These errors require developer fixes and should be ignored by editors. When checking for endemic errors, ensure a blank page is used, such as Special:BlankPage.

This is allowed per the . srcset allows the MediaWiki software to render alternate images based on the device capabilities. The W3C HTML validator has not yet been updated to support this and throws an error.

While current browsers are quite forgiving of HTML errors, invalid HTML can cause issues with accessibility, search engines and portability. Various browsers may handle errors differently, thus the display may differ.

For most editors, creating valid HTML is not an issue. The MediaWiki software converts wikimarkup into valid HTML (with occasional bugs). The English Wikipedia has used HTML Tidy, a now-outdated HTML4 library, to help ensure that common typos and mistakes are converted into proper HTML4. However, Tidy could not fix all problems, there is no way to disable it for testing and validation will not show issues fixed by Tidy. Furthermore, Tidy is slated for removal at Wikipedia, so previously overlooked errors need to be fixed.

Portability issues occur when pages are exported to other wikis that do not use HTML Tidy and HTML errors are exposed.

Editors who use referencing methods such as Footnote3 should always validate pages. Use of these templates make it very easy for an editor to create duplicate HTML ids, causing invalid HTML and in-page linking issues – this is probably the most common validation issue on Wikipedia. There is little or no error checking for manual templates.

Editors who develop templates should always test various uses and ensure they render valid HTML.

The W3C is the main international standards organization for the internet— they provide the W3C Markup Validation Service. Simply copy the full URL of the page to be validated and paste in into the validator. There is also a favelet that you can add to your browser bookmarks that will validate the current page.

The WDG HTML Validator has a batch mode that allows a list of URLS to be validated.

Sharebox is a user script that will add sharing links and include tools including W3C Markup Validation.

This section gives examples of diagnostics generated by the markup validation service, and suggests possible fixes. Diagnostics are by line and column of the generated HTML for the page. It may be helpful to obtain the HTML in order to understand the diagnostic. For example, if you using the Firefox browser, you can type control-U to see the HTML.

An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).
The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element....

This diagnostic can result from use of the EasyTimeline extension, which does not support accessibility and does not generate alternative text for visually impaired readers. Such a problem can be fixed by redoing the timeline as text, as an image, or as an image map.

Zero or more groups each consisting of one or more dt elements followed by one or more dd elements.

Definition lists are created with the wikimarkup ; to define a definition list and : to define the item in the list. This diagnostic results when the : is missing.

The W3C also has a CSS validator, but this is less of an issue when editing Wikipedia pages, as CSS is an option and CSS validation errors typically are due to problems with skins, not problems in individual pages.