Skip to main content
HTML Validation

Bad value “http://www.w3.org/1999/html” for the attribute “xmlns” (only “http://www.w3.org/1999/xhtml” permitted here).

About This HTML Issue

The xmlns attribute declares the XML namespace for the document. When present on the <html> element, the HTML specification requires its value to be exactly http://www.w3.org/1999/xhtml — no variations allowed. The URL http://www.w3.org/1999/html is not a recognized namespace and will be rejected by the validator. This error almost always comes from a typo: the “x” before “html” was accidentally omitted.

Why this matters

While most browsers will still render the page in HTML mode regardless of a malformed xmlns value, an incorrect namespace can cause real problems in certain contexts:

  • XHTML processing: If the document is served with an XML content type (e.g., application/xhtml+xml), an invalid namespace will cause XML parsers to reject or misinterpret the document.
  • Standards compliance: Validators and automated tools flag this as an error, which can affect quality audits, accessibility checks, and CI/CD pipelines that enforce valid markup.
  • Tooling and interoperability: XML-based tools, content management systems, and XSLT transformations rely on correct namespaces to function properly.

How to fix it

You have two options depending on your document type:

  1. If you need the xmlns attribute (e.g., for XHTML or polyglot documents): Change the value from http://www.w3.org/1999/html to http://www.w3.org/1999/xhtml.
  2. If you’re writing standard HTML5: Simply remove the xmlns attribute. It’s optional in HTML5 and has no effect when present with the correct value — so omitting it is the cleanest approach.

Examples

Incorrect — misspelled namespace

The value is missing the “x” before “html”:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html" lang="en">
  <head>
    <title>My Page</title>
  </head>
  <body>
    <p>Hello, world!</p>
  </body>
</html>

Fixed — correct XHTML namespace

Add the missing “x” so the value reads xhtml:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <title>My Page</title>
  </head>
  <body>
    <p>Hello, world!</p>
  </body>
</html>

Fixed — standard HTML5 without xmlns

If you don’t need XHTML compatibility, remove the attribute altogether:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>My Page</title>
  </head>
  <body>
    <p>Hello, world!</p>
  </body>
</html>

For most modern websites served as text/html, the third option — omitting xmlns entirely — is the simplest and recommended approach. Only include it if your document must also be valid XHTML or will be processed by XML tooling, and always ensure the value is exactly http://www.w3.org/1999/xhtml.

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?

Ready to validate your sites?
Start your trial today.