uri vs url

Without a doubt, the digital realm can be a confusing and overwhelming place, especially if you want to get really technical.

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.

URI

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:

foo://example.com:8043/there/above?name=parrot#beak

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:

URI: telnet://192.0.2.16:80/.

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.

 

URI Types

Before getting too technical, there are two basic URI types. URNs and URLs.

URN

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:

Urn:oasis:names:specification:docbook:dtd:xml:4.1.2

URL

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.

uri vs url
Image source: Unsplash

 

URL

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.


Finishing Thoughts

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.

Szabolcs Szecsei

Szabolcs Szecsei born on February 4th, 1989, A Hungarian writer, living in Novi Sad, Serbia. With a master’s degree in Communication and Media Studies, Szabolcs has been working in the news and marketing industry for more than six years. Apart from writing, Szabolcs is also a professional touring and recording musician, working for several bands and projects.