What Is The Difference Between A URI And A URL?

Milecia - Oct 11 '18 - - Dev Community

Working as a web developer means it's good to know as much about how the internet works as possible. It also means you'll hear a lot of acronyms that aren't always used correctly.

An example of some of the acronyms you'll hear are URIs and URLs. While they are used interchangeably, there are some subtle differences. For starters, URI stands for uniform resource identifier and URL stands for uniform resource locator.

Most of the confusion with these two is because they are related. You see, a URI can be a name, locator, or both for an online resource where a URL is just the locator. URLs are a subset of URIs. That means all URLs are URIs. It doesn't work the opposite way though.

Not all URIs are URLs because a URI could be a name instead of a locator. Here's an illustration of the difference between the two:

difference between a uri and a url

Your name could be a URI because it identifies you, but it couldn't be a URL because it doesn't help anyone find your location. On the other hand, your address is both a URI and a URL because it both identifies you and it provides a location for you.

In the web dev world, you might be trying to get different resources by name so you'll have different URIs that have distinct URLs. And that's how the confusion started. Now that you know the difference, hopefully it won't be as hard for you to figure out what you need and where to find it when people start talking about resources.

Remember, a URL is the locator of a resource. The URI is the identifier of the resource and it can just happen to be a locator. I hope this helped clear up some of the jargon we use!

I always like to hear from you guys so tell me something good in the comments!


Hey! You should follow me on Twitter because reasons: https://twitter.com/FlippedCoding

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player