The main difference between URL and URI is that the URL allows identifying a web resource only by its location while the URI allows identifying a web resource using the name or location or both.
URL and URI are two terms that are used interchangeably. But there is a difference between URL and URI. URL is a string of characters that helps to identify a resource on the web using the location. URI is a string of characters that helps to identify a resource on the web either by using the location, name or both of them. In other words, URI specifies the name and the location of the resource on the web. It can describe the URL. Furthermore, the URL is the most common type of URI.
Key Areas Covered
URI, URN, URL
What is URL
URL stands for Uniform Resource Locator. It is a string of characters that defines the address. It is the most common way to identify the location of the resource in the World Wide Web (WWW).
Other than the URL, there is another identification string called URN. It stands for Uniform Resource Name. It is a string of characters that defines the name of the resource. As two resources can have the same name using URN is not very effective. Therefore, the URL is commonly used. URL is infact the web address. Most web browsers display the URL of a web page above in the address bar.
An example URL is as follows.
http defines the protocol while www refers to the World Wide Web. The shoppingworld.com refers to the domain name. It is a set of characters that define the website. The www.shopping world.com section is also referred as the hostname. The products/product.php is the path to the file. The product.php is the exact file name.
What is URI
URI stands for Uniform Resource Identifier. It is a string of characters used to identify a resource on the web either by location or by name or by both.
URL and URN are types of URI. Therefore, the URI can describe both URL and URN. It is a superset of URL and URN. Moreover, it can include authority, scheme fragment, and query.
Difference Between URL and URI
URI is a string of characters designed for unambiguous identification of resources and extensibility via the URI scheme. URL is a web address that refers to a web resource that specifies its location on a computer network and a mechanism for retrieving it.
Uniform Resource Locator is the long form of URL. Uniform Resource Identifier is the long form of URI.
URL is a type of URI. URI is the superset of URL.
While URL helps to identify a web resource using the location, URI helps to identify a web resource either by name, location or both.
The difference between URL and URI is that the URL allows identifying a web resource only by its location while the URI allows identifying a web resource using the name or location or both. In brief, the URL is a specific type of URI. The URI that specifies the location of the web resource is called the URL.
1. “Uniform Resource Locator (URL) example”By Meilani.conley – Own work (CC BY-SA 4.0) via Commons Wikimedia
2. “URI Euler Diagram no lone URIs”By David Torres original author derivative work: Qwerty0 (talk) – URI_VENN_DIAGRAM.SVG (CC BY-SA 3.0) via Commons Wikimedia