URN

Also known as: Uniform Resource Name

On this page 7

A URN, or Uniform Resource Name, is a URI that identifies a resource by a persistent, location-independent name rather than by the network location where a copy can be retrieved. Among Internet protocols and naming schemes, it answers the question “which resource is this?” and deliberately leaves “where can it be fetched?” to a separate resolution step.

URNs are defined by the IETF in RFC 8141, which replaced the earlier RFC 2141 and RFC 3406. They are used wherever an identifier must outlive servers, domain names and organizations: books, standards documents, XML namespaces, legal acts, academic publications and device identifiers. A URN is a subset of the broader URI family, while a URL is the location-oriented subset that tells a client how and where to access something.

How URN syntax is structured

Every URN follows the fixed pattern urn:<NID>:<NSS>, where the namespace identifier (NID) names the registered naming authority and the namespace-specific string (NSS) carries the actual identifier under that authority’s own rules. The scheme name urn and the NID are case-insensitive, while case sensitivity of the NSS depends on the namespace.

RFC 8141 also introduced optional components that follow the NSS: the r-component (starting with ?+) passes parameters to a resolver, the q-component (starting with ?=) passes parameters to the named resource itself, and the f-component (starting with #) addresses a fragment. These components are not part of URN equivalence, so two URNs that differ only in them still name the same resource.

The table below breaks a typical URN into its parts and explains the role each one plays.

PartExampleRole
SchemeurnMarks the identifier as a URN
Namespace identifierisbnNames the registered naming authority
Namespace-specific string9780134685991Identifier assigned under that namespace
R-component?+format=pdfHints for the resolution service
Q-component?=lang=enParameters for the resource or its provider
F-component#section2Points to a part of the resource
Parts of a URN and their function

Registered URN namespaces

A URN is only as meaningful as its namespace, so formal namespaces are registered with IANA through a documented process that describes the assignment rules, uniqueness guarantees and persistence commitments of the responsible organization. Informal namespaces using the urn-<number> form and experimental X- prefixes were once allowed, but RFC 8141 discourages experimental namespaces in production use.

Several widely used namespaces illustrate how different communities apply the same syntax to very different resources.

NamespaceTypical identifierUsed for
isbnurn:isbn:9780134685991Published books
issnurn:issn:0167-6423Serial publications and journals
ietfurn:ietf:rfc:8141IETF documents and parameters
uuidurn:uuid: followed by a UUIDGlobally unique generated identifiers
oidurn:oid:2.16.840Object identifiers from the ASN.1 tree
nbnurn:nbn:de: plus a national numberNational library deposit records
lexurn:lex: plus jurisdiction dataLegislation and legal documents
Common URN namespaces in use

The uuid namespace is especially common in software because any system can generate a unique value without central coordination, which makes it useful for message IDs, device identifiers and XML or JSON document identifiers.

How URN compares with URL and URI

A URN differs from a URL in that it names a resource without locating it, while both are subsets of the general URI syntax. The distinction matters in system design because a URL breaks when a server moves or a domain lapses, whereas a well-managed URN keeps its meaning indefinitely.

PropertyURNURLURI
Primary purposePersistent namingLocating and accessingAny identification
Contains access methodNoYes, through the schemeDepends on the scheme
Survives server movesYes, by designUsually notDepends on the subtype
Directly retrievableOnly through a resolverYesOnly if it is a URL
Exampleurn:ietf:rfc:3986https://example.org/aEither of the two
URN, URL and URI side by side

Modern specifications, including RFC 3986, treat the URN and URL labels as informal classifications rather than separate syntaxes. In practice, “URI” is the umbrella term, and “URN” describes the specific urn: scheme with its persistence intent. Closely related Terms such as URL and URI each have their own definitions.

Resolving a URN to an actual resource

Because a URN carries no location, resolution is the process that maps the name to one or more URLs, metadata records or the resource itself. Resolution is not built into the URN standard; each namespace or community chooses its own mechanism, which is why a browser cannot open most URNs directly.

Typical resolution approaches range from simple lookup services to DNS-based delegation. The Dynamic Delegation Discovery System (DDDS), using NAPTR records in DNS, was designed for this purpose, although real deployments more often rely on dedicated web resolvers run by libraries or registries.

MechanismHow it worksTypical setting
Central resolver serviceHTTP lookup returns a redirect or recordNational library NBN resolvers
DDDS with NAPTRDNS rewrite rules point to a resolverResearch and early deployments
Local catalog lookupApplication maps the name in its databaseLibrary and archive systems
No resolutionName is compared, never fetchedXML namespaces and UUIDs
Ways to resolve URNs

Many URNs are never resolved at all. An XML namespace such as urn:oasis:names:tc:SAML:2.0:assertion only needs to be globally unique and comparable; software matches the string and never attempts to download anything.

Equivalence rules and practical pitfalls

Two URNs are considered equivalent when they match after lexical normalization: lowercasing the urn scheme and the NID, normalizing percent-encoding to uppercase hexadecimal, and ignoring the r-, q- and f-components. Namespaces may define additional equivalence rules, such as treating ISBN hyphens as insignificant.

  • Treating a URN as a URL: expecting a browser to open it leads to broken links unless a resolver is configured.
  • Inventing unregistered namespaces: using a made-up NID undermines global uniqueness and may collide with a future registration.
  • Ignoring namespace rules: comparing ISBN or ISSN URNs as raw strings can miss equivalent identifiers.
  • Assuming persistence is automatic: a URN is only persistent if the naming authority maintains its commitments.

The central trade-off is clear: a URN delivers stability of identity at the cost of extra infrastructure for resolution. Systems that need durable references, such as archives and standards bodies, accept that cost, while ordinary web pages usually rely on URLs and redirects.

A non-technical view

A URN works like a name that never changes, while a URL works like a street address. A book’s ISBN stays the same whichever library or shop holds a copy, just as a person keeps the same name after moving house.

Because the name says nothing about location, something else has to look it up and tell you where a copy lives. That lookup step is called resolution. The key idea is identity first, location second: the URN tells everyone exactly which thing is meant, even many years later.

A concrete example

A national library collects doctoral theses from universities and must keep them citable for decades, even though university websites are redesigned every few years. For each deposited thesis, the library assigns an identifier in the nbn namespace, for example a value beginning with urn:nbn:de:, and records it in its catalog together with the current file locations.

Researchers cite the URN instead of a university URL. When a reader enters the URN into the library’s resolver, the service returns the current location of the PDF, whether it sits on the university repository or the library’s own archive. When a university migrates its repository and thousands of old URLs break, the library only updates its resolver records, and every published citation keeps working without a single change to the cited identifiers.