Skip to main content
HTML Validation

Attribute “xmlns:svg” not allowed here.

About This HTML Issue

The xmlns:svg attribute is not allowed on the <svg> element in HTML5 and causes validation errors.

The SVG specification only requires the xmlns (not xmlns:svg) attribute for embedding SVG in HTML, and custom namespace prefixes like xmlns:svg are not needed or permitted in HTML5. The sole required namespace declaration is xmlns="http://www.w3.org/2000/svg". The xmlns:svg form was only used in extremely outdated XML-based workflows and has no place in current HTML.

Incorrect HTML Example:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<!-- SVG content here -->

</svg>

Correct HTML Example:

<svg xmlns="http://www.w3.org/2000/svg">
<!-- SVG content here -->

</svg>

In summary:

  • Use only xmlns="http://www.w3.org/2000/svg" in inline SVG within HTML documents.
  • Remove xmlns:svg and any other prefixed namespace attributes unless specifically required for XML workflows, not HTML.

Last reviewed: May 07, 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.