The Official XML Namespace URI for SVG

This article identifies the official XML namespace Uniform Resource Identifier (URI) required for standard Scalable Vector Graphics (SVG) documents. It explains what the URI is, why it is essential for rendering standalone graphic files, and how to implement it correctly within your code.

The Standard SVG Namespace URI

The official XML namespace URI for standard SVG documents defined by the World Wide Web Consortium (W3C) is:

http://www.w3.org/2000/svg

Even though modern web protocols prioritize HTTPS, the namespace string itself is a fixed identifier and must use the exact http:// prefix rather than https://.

How to Declare the Namespace

To declare the namespace in an SVG document, attach the xmlns attribute to the root <svg> element.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="100" height="100">
  <circle cx="50" cy="50" r="40" fill="blue" />
</svg>

When the Namespace Is Required

The necessity of the SVG namespace depends on the context in which the graphic is served:

When working with advanced or legacy SVG features, you may encounter secondary namespaces alongside the primary SVG URI: