}

Is It a URI, a URL, Or Both?

view of web address bar in browser

A URL is a URI, and so is a URN, but a URL isn't a URN and not all URIs are URLs. Clear? No? OK, we'll look at these in more detail and Try to clear up some of the conflict?

browser search bar

What is a URI?


A URI us a "Uniform Resource Identifier". It is a way to uniquely identify something. The mechanism is designed to be extensible and uses human-readable characters. The Wikipedia entry I linked above does a great job of describing URIs, and the link itself is a URI: https://en.wikipedia.org/wiki/Uniform_Resource_Identifier. Specifically, it is a type of URI called a URL. A URL is a Uniform Resource Locator and is familiar to all web users.

A URL is a URL because it tells a web browser, or perhaps some other tool, where something is located. It can uniquely identify an instance of a document, for instance, even if there are many copies on the web.

But what if one wants to just identify a thing for which there may be many copies without specifying a particular one? That's where the URN or Uniform Resource Name comes in. URNs, use namespaces to identify the type of the URN. Books are identified in the namespace isbn which refers to the book's International Standard Book Number. For example, the 2016 edition of Edward de Bono's Six Thinking Hats has a 10-digit ISBN of 0241257530 and a URN of urn:isbn:0241257530.

So Should I call a URL a URI?


The answer is "maybe". In 2001 the W3C (The World Wide Web Consortium) recommended just using "URI", and to stop using URL and URN. But that hasn't stopped people from using "URL", has it? Nope. In fact, the WHATWG (Web Hypertext Application Technology Working Group - basically the major browser writers) still uses and encourages using "URL". While neither recommendation is designed to confuse the uninitiated, they combine to do a great job of that.

Part of what confuses many people is when they see URLs that begin with file or mailto that don't look like the URLs they know (that begin with http or https). People who have heard of URIs, but don't know that these are URLs default to calling them "URIs" which is correct, but may confuse some readers.

I think it only really matters if you are writing something formal and need to address the specific direction of the W3C or the WHATWG. Call it what seems most familiar to your readers or listeners. I have decided on the following rules for me, for now:

    • If it is a URL, I will call it a URL. Not just because WHATWG says so, but it is common use.
    • If it is a URN, I will call it a URN, although I seldom use them. I do this because they begin with "urn"!
    • I will use URI if I want to include URLs and URNs in one mention.

Personally, it is not all that important so long as the point is clear.

Related Training:
Web Development