Take the 2-minute tour ×

What's the difference between an URI, URL and URN? I have read a lot of sites (even Wikipedia) but I don't understand it.

URI: http://www.foo.com/bar.html
URL: http://www.foo.com/bar.html
URN: bar.html

Is this correct?

share|improve this question
possible duplicate of What's the difference between a URI and a URL? –  Robert MacLean Mar 8 '12 at 10:50
Worth reading (perhaps after reading the answer provided below): w3.org/TR/uri-clarification Also, the following two links may help clarify when something is a URL VS URN. Permanent URI Schemes: (URL/URN namespaces I guess, though URN has it's own entry in this list which leads to the next link I provide here) iana.org/assignments/uri-schemes.html URN Namespaces: www.iana.org/assignments/urn-namespaces/urn-namespaces.xml –  Lemmings19 Jun 26 '12 at 22:11

3 Answers 3

up vote 100 down vote accepted

Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

A URI identifies a resource either by location, or a name, or both. A URI has two specializations known as URL and URN.

A Uniform Resource Locator (URL) is a subset of the Uniform Resource Identifier (URI) that specifies where an identified resource is available and the mechanism for retrieving it.URL defines how the resource can be obtained. It does not have to be HTTP URL (http://), a URL can also be (ftp://) or (smb://)

A Uniform Resource Name (URN) is a Uniform Resource Identifier (URI) that uses the URN scheme, and does not imply availability of the identified resource. Both URNs (names) and URLs (locators) are URIs, and a particular URI may be both a name and a locator at the same time.

The URNs are part of a larger Internet information architecture which is composed of URNs, URCs and URLs.

bar.html is not a URN. A URN is similar to a person's name, while a URL is like a street address. The URN defines something's identity, while the URL provides a location. Essentially, "what" vs. "where". A URN has to be of this form <URN> ::= "urn:" <NID> ":" <NSS> where <NID> is the Namespace Identifier, and <NSS> is the Namespace Specific String.

To put it differently:

  • A URL is a URI that identifies a resource and also provides the means of locating the resource by describing the way to access it
  • A URL is a URI
  • A URI is not necessarily a URL

I'd say the only thing left to make it 100% clear would be to have an example of an URI that is not an URL. We can use the examples in the RFC3986:

URL: ftp://ftp.is.co.za/rfc/rfc1808.txt
URL: http://www.ietf.org/rfc/rfc2396.txt
URL: ldap://[2001:db8::7]/c=GB?objectClass?one
URL: mailto:John.Doe@example.com
URL: news:comp.infosystems.www.servers.unix
URL: telnet://
URN (not URL): urn:oasis:names:specification:docbook:dtd:xml:4.1.2
URN (not URL): tel:+1-816-555-1212 (?)
share|improve this answer
Perhaps an example can clarify this: the ISBN number used for books is in fact a URN, it's a unambiguous identifier for a given book. But a ISBN number is not a URL as it does not define where the book can be found. –  Stefan Gehrig Feb 6 '11 at 12:51
urn:isbn:0-486-27557-4 (a specific edition of Shakespeare's play Romeo and Juliet) is in fact a URN (and therefore it's a URI), but it's not a URL. –  Stefan Gehrig Feb 6 '11 at 12:53
By the way: the tel example is not a perfect one as one might argue that it is in fact a URL (even tough it's not a URL in the common internet-influenced area). –  Stefan Gehrig Feb 6 '11 at 12:56
@thom : check w3.org/TR/uri-clarification for more. –  ayush Feb 6 '11 at 13:06
@ayush: A telephone number is in fact the description of the location of a given telephone connection. The number allows the telephone system to locate the receiver in the world-wide telephone network due to its unique telephone number and route the call appropriately (+1 for the USA, 816 for Missouri, etc.). –  Stefan Gehrig Feb 6 '11 at 13:07

Below I sum up Prateek Joshi's awesome explanation.

The theory:

  • URI (uniform resource identifier) identifies a resource (text document, image file, etc)
  • URL (uniform resource locator) is a subset of the URIs that include a network location
  • URN (uniform resource name) is a subset of URIs that include a name within a given space, but no location

That is:

enter image description here

And for an example:

enter image description here

Also, if you haven't already, I suggest reading Roger Pate's answer.

share|improve this answer
Thanks, this really explains it in a simple way. –  Maksim Luzik Oct 22 at 11:00

URI (Uniform Resource Identifier) according to Wikipedia:

a string of characters used to identify a name of a resource.

URL (Uniform Resource Locator) is a URI that implies an interaction mechanism with resource. for example http://www.google.com specifies the use of HTTP as the interaction mechanism. Not all URIs need to convey interaction-specific information.

URN (Uniform Resource Name) is a specific form of URI that has urn as it's scheme. For more information about the general form of a URI refer to http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax

IRI (International Resource Identifier) is a revision to the definition of URI that allows us to use international characters in URIs.

share|improve this answer

Your Answer


