Skip to main content
HTML Validation

Bad value https://www.w3.org/1998/Math/MathML for the attribute xmlns (only http://www.w3.org/1998/Math/MathML permitted here).

About This HTML Issue

Use the MathML namespace with http:// (not https://) in the xmlns value.

Explanation

The xmlns attribute defines an XML namespace. For MathML in HTML or XHTML, the only permitted namespace URI is:

  • http://www.w3.org/1998/Math/MathML

Using https:// is not equivalent and fails validation. In HTML5, embedded MathML typically doesn’t set xmlns on <math>; the parser assigns the MathML namespace automatically. In XHTML or XML contexts, xmlns="http://www.w3.org/1998/Math/MathML" is required on the <math> element (or inherited from an ancestor).

HTML examples

Reproducing the issue (invalid https:// namespace)

<!DOCTYPE html>
<html lang="en">
<head>
  <title>MathML Invalid Namespace</title>
</head>
<body>
  <math xmlns="https://www.w3.org/1998/Math/MathML">
    <mi>x</mi><mo>+</mo><mn>1</mn>
  </math>
</body>
</html>

Fix in HTML5 (omit xmlns; let HTML set the namespace)

<!DOCTYPE html>
<html lang="en">
<head>
  <title>MathML Correct in HTML</title>
</head>
<body>
  <math>
    <mi>x</mi><mo>+</mo><mn>1</mn>
  </math>
</body>
</html>

Fix in XHTML/XML (use the exact http:// URI)

<!DOCTYPE html>
<html lang="en">
<head>
  <title>MathML Correct in XHTML/XML</title>
</head>
<body>
  <math xmlns="http://www.w3.org/1998/Math/MathML">
    <mi>x</mi><mo>+</mo><mn>1</mn>
  </math>
</body>
</html>

Learn more:

Last reviewed: August 11, 2025

Was this guide helpful?

Find issues like this automatically

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

Ready to validate your sites?
Start your free trial today.