Difference Between Uniform Resource Identifier (URI) and Uniform Resource Locator (URL)

URL stands for Uniform Resource Locator while URI stands for Uniform Resource Identifier. URI and URL are the terms which are often used interchangeably but they have slightly different meaning.

URI is a more general term that enclose both URLs and URNs (Uniform Resource Names).




A URI is a string of character that identifies a name or resource on the internet. It provides a way to uniquely identify a resource, such as web page, a file or an API endpoint.

URL, on the other hand, is a specific type of URI that includes the network location (domain name) of a resource, along with protocol used to access it. In other words, a URL is a type of URI that includes the full address of a resource on the web, including the protocol (e.g. HTTP, HTTPS), the domain name (e.g. www.example.com) and the path to the resource (e.g. /path/to/file).


Here is an example to illustrate the difference.

URI - urn:isbn:0-7475-3269-9 

This is a URI that identifies a resource using a unique name based on the international standard book number (ISBN)

URL - https://www.example.com/index.html

This is a URL that includes the protocol (HTTPS), the domain name (www.example.com) and the path to the resource (index.html).


In a summary, URI is more general term that enclose both URLs and URNs, while URL is a specific type of URI that includes the network location of a resource along with the protocol used to access it.


Comments