What’s the difference between URI, URN and URL?
Jorge Reyes – Fri Aug 27 2021
2 min.
While browsing the web we encounter words like URL, this is a common tech term, but as we go deeper in the tech field, there's another terms that shows up, that's URI and the least common URN.
What the fork are these terms?
The first thing to understand is the wider term, the Uniform Resource Identifier (URI). It does what it says, it's just the identifier of a resource in the internet like a hyper-text document, a file, an image, or anything that can be stored.
Think about the URI as group term, it can refer to an URN or a URL.
The Uniform Resource Name (URN)
This is a formal way of naming a resource, ensuring that this resource name is unique. It's made by following a predefined scheme.
For example, we can use the ISBN scheme as:
urn:isbn:0451450523
The Uniform Resource Locator (URL)
Imagine we want to access the contents of an specific resource, say a book (.pdf
for example), we will need not only need the information about this resource location, we also need information about how we can access it, that's when the Uniform Resource Locator (URL) comes at hand, because it appends a prefix about how we can access this resource.
Using a protocol before the resource location gives to us the URL.
For example, we can use the Hashnode address:
https://hashnode.com
Conclusion
All the URNs and URLs are URIs, and while the URN only identifies resources without telling you how to access them, the URL do tell you where and how to access the desired resource.
Hope you find this useful, see you next time 👋.
If you noticed any error, please let me know. I'm always up to learning or relearning if necessary.