In this tutorial, we are going to discuss about URL vs URI vs URN. URL (Uniform Resource Locator), URI (Uniform Resource Identifier), and URN (Uniform Resource Name) are all components of web addressing and identification.

Understanding the differences between URL, URI, and URN can be crucial in web development and networking.


Let’s break down these concepts:

URL (Uniform Resource Locator)
url anatomy
  • Definition:
    • A URL is a specific type of URI that provides the means to locate a resource by specifying its network location and the protocol used to access it.
    • We have to deal with URLs every day. URL is an acronym that stands for Uniform Resource Locator. Maybe the expanded name may sound weird, but you can simply call it address. The term address explains very well the role of a URL. You can think of a URL like your home address: it contains all the information to find your home.
  • Components:
    • A URL typically consists of several components:
      • Protocol (e.g., HTTP, HTTPS, FTP)
      • Domain name or IP address
      • Port number (optional)
      • Path to the resource on the server
      • Additional parameters or query strings
      • Anchor: this part represents a specific part inside the resource. It is also called fragment.
  • Example: https://www.waytoeasylearn.com/learn/what-is-system-design/
  • Key Characteristics:
    • Specifies how the resource can be accessed (protocol).
    • Includes the location of the resource (like a web address).
  • Purpose: URLs are used in web browsers to navigate to specific web pages or resources on the internet.
URI (Uniform Resource Identifier)
  • Definition:
    • A URI is a string of characters used to identify a resource on the internet. It can be further classified into two sub types: URL and URN.
    • Both URLs and URIs follow the same specification: RFC 3986. However, while URLs allow you to locate a resource, a URI simply identifies a resource. This means that a URI is not necessarily intended as an address to get a resource. It is meant just as an identifier.
    • Going back to the address example, if you say you live in the only yellow house in your town, you are not giving directions on how to get there. However, this information identifies your house among the others in your town.
  • Scope: All URLs and URNs are URIs, but not all URIs are URLs or URNs.
  • Example: A URL https://www.example.com is also a URI, and a URN like urn:isbn:0451450523 (identifying a book by its ISBN) is also a URI.
  • Key Characteristics:
    • A more general concept than both URL and URN.
    • It can be either a locator (URL), a name (URN), or both.
  • Purpose: The primary purpose of a URI is to provide a standard way to identify resources, regardless of the protocol used to access them.
URN (Uniform Resource Name)
  • Definition: A URN is another subtype of URI that provides a persistent and location-independent identifier for a resource. Unlike URLs, URNs do not specify how to locate the resource; instead, they serve as unique identifiers.
  • Format: URNs are structured similarly to URLs but lack the network location component. Instead, they typically use namespaces to ensure uniqueness.
  • Example: urn:isbn:0451450523 uniquely identifies a book using its ISBN, irrespective of where it exists.
  • Key Characteristics:
    • Provides a unique and persistent identifier.
    • Does not specify a location or method to access the resource.
  • Purpose: URNs are designed to provide long-lasting and globally unique identifiers for resources, making them useful for referencing resources in a standardized and persistent manner.

To summarize the differences between these overlapping concepts, check out this infographic

Summary of Differences
  • URL: Specifies both the identity and the location of a resource (How and Where).
  • URI: A more comprehensive term covering both URLs (identifying and locating) and URNs (just identifying).
  • URN: Focuses only on uniquely identifying a resource, not on where it is located or how to access it.

In practical terms, when you’re browsing the internet, you’re mostly dealing with URLs. URIs and URNs come more into play in specific contexts like software development, digital libraries, and systems where unique and persistent identification of a resource is crucial.

That’s all about URL vs URI vs URN in network essentials. If you have any queries or feedback, please write us email at contact@waytoeasylearn.com. Enjoy learning, Enjoy system design..!!

Scroll to top