URI vs. URL: What’s the Difference?
There are almost literally unlimited resources for everything, starting with web pages through millions of images to electronic documents, and then some.
As such, it’s rather important to identify and retrieve these various resources properly.
And to be able to pull that off, chances are, at some point, you’ll want to know what the differences are between URLs and URIs.
So, let’s kick things off by defining each of them.
The term URI is short for “Uniform Resource Identifier”, and refers to a sequence of characters to differentiate a resource from another.
Here’s an example:
This would be a URI, with its own scheme name, authority, path, then its query, and finally, fragment.
Generally speaking, you can also come across a URI without all these components. All in all, it needs to have a scheme name and a file path to be a URI.
Here’s another example:
Here, “telnet” is the name of the scheme, and the following numbers after the double dash are the authority. The path in this example is fully empty, meaning there are no characters following the slash.
Before getting too technical, there are two basic URI types. URNs and URLs.
The first one refers to Uniform Resource Name (URN). This is a persistent and usually location-dependent identifier that follows the “urn” scheme. From this perspective, the term “persistent” means that a URN persistently identifies the exact same resource over time.
As such, here’s an RFC 3986-provided URN example:
URLs are location-dependent identifiers that are not persistent per se. What this means is, a URL is not actually required to identify the same resource over time, They also do not tend to follow the “urn” scheme.
So, by now, you can clearly see what URI’s are and that URLs are basically a URI type. However, let’s take a closer look at URLs as they have a few unique characteristics that you should know about.
This term is short for “Uniform Resource Locator” and is a specific identifier type that identifies the resource and also tells you how you can access it or where you can find it.
For instance, if your URL contains something like this: ftp:// or https://. — it basically tells you where you can locate the resource and that you can access it through the FTP (File Transfer Protocol) or HTTPS (Hypertext Transfer Protocol Secure).
Here is an URL example: https://www.popwebdesign.net/popart_blog/en/
It’s rather clear to see that these examples are quite similar to the URI examples that we’ve already discussed above. That’s mainly because these URLs also contain several of the same components as URIs, including components like query and path.
However, when presented with a URL, you will also see a few unique components, like domain and protocol too.
That being said, just take a look at the last example. There, https:// is the protocol, and the term “offers” is the subdomain, while “hubspot.com” is the name of the domain. The “ how-to-run-seo-audit “ is your path in this example, and the question mark and everything that follows is the query.
So, now that you understand what they are, let’s look at the key differences between the two.
URI vs URL: The Differences
When looking at these two, experts will usually point out that URIs are identifiers, while, in most cases, URLs are locators. To put it differently, URIs generally identify the resource but do not describe or try to imply how to locate said resource while URLs do exactly just that.
From that perspective, URLs present a specific URI subset. To be even more specific (not to mention, dramatic) all URLs are UIs, but not all URIs have what it takes to be URLs.
When looking at the most common ways to understand the basic references between the two, experts often use the analogy of comparing a person’s name to their address. In this analogy, the name would be the URI as it identifies that given person without providing any more info (like how to locate them). When looking at the address, however, the person is identified as a resident of said address, providing their physical location as well. That would be a URL.
The other major difference professionals often point out to differentiate the two is the fact that you can use URIs to identify and differentiate specific files from each other like XML and HTML. URLs, from this perspective, can only be used to locate and/or identify the web pages.
All in all, the differences can be subtle to the untrained eye but from a professional perspective, there are quite a lot of key differences between URLs and URIs. Hopefully, now you too have a better understanding of them.
Originally published at https://www.popwebdesign.net on November 1, 2021.