URI vs URL vs URN: Understanding the Differences
Advertisement
This article clarifies the distinctions between URI, URL, and URN.
URI - Uniform Resource Identifier
-
As the name suggests, URI stands for Uniform Resource Identifier.
-
It acts as a label that names or locates a resource on the internet.
-
In essence, a URI is a string of characters used to identify a resource on the internet, either by its location, name, or both.
-
Analogy: Think of it as a person’s contact details, including email, phone number, and address.
-
Example:
Name: Alex Willer Address: 7081 Columbia street Woonsocket, RI
image alt: URI URL URN
URL - Uniform Resource Locator
-
URL stands for Uniform Resource Locator.
-
It’s a string of characters that specifically uses the address to locate a resource.
-
It defines the protocol used to communicate with the resource.
-
Examples of protocols used in URLs include FTP, HTTP, FILE, and MAILTO.
-
Analogy: It’s one specific way to contact a person, like using their physical address.
-
A URL is a type of URI.
-
Example:
Address: 7081 Columbia street Woonsocket, RI
A URL consists of at least two required components: a protocol and a domain. Optional components include the path and port.
Example: https://www.rfwireless-world.com:80/Tutorials/networking-tutorial.html
http
indicates the protocol.www.rfwireless-world.com
indicates the domain.80
indicates the port (optional)./Tutorials/networking-tutorial.html
indicates the path (optional).
URN - Uniform Resource Name
-
URN stands for Uniform Resource Name.
-
It identifies a resource only by its name. No location or other contact information is provided.
-
URNs define namespaces.
-
Analogy: It’s like knowing a person’s name but not their address or phone number.
-
Example:
Name: Alex Willer
-
A book’s ISBN (e.g., ISBN 0-486-27557-4) is designated as a URN. To access the book, you’d need its URL (location).
Summary
Both URNs and URLs are types of URIs. In short, URIs specify an address (URL), a name (URN), or both. URLs are most commonly used to identify resources on the internet.