What is the difference between URL and URI?
Author: Domeny.ForSale editorial team Published
In brief: A URI identifies a resource, while a URL also specifies how to access that resource and where it is located. In the traditional classification, every URL is a URI, but not every URI is a URL. You can therefore correctly call a website address either a URL or a URI — in everyday conversation, “URL” will usually be more readily understood.
What does URI mean?
URI stands for Uniform Resource Identifier. A resource can be a web page, an image, a document, an item made available through an API, or even an object that cannot simply be downloaded from the internet.
The main purpose of a URI is identification: specifying which resource is meant. The identifier itself does not have to say where that resource is located or how to access it.
One example is urn:isbn:9780131103627. This identifies a publication using its ISBN. It does not point to a particular bookshop, library or downloadable file. It identifies the publication without giving its web address.
URI is therefore a broader concept than a website address. It is a category of identifiers that also includes familiar addresses beginning with https:.
What does URL mean?
URL stands for Uniform Resource Locator. It specifies a resource’s location and the mechanism for accessing it, for example through HTTPS.
An example URL is https://example.com/guide. It contains the information a browser needs to begin attempting to access the specified page:
https— the scheme, which in this case specifies the use of the HTTPS protocol;example.com— the hostname, which here is a domain name;/guide— the path identifying a resource on that host.
An address can also contain a port, query parameters and a fragment. In https://example.com/poradnik?jezyk=pl#wprowadzenie, the language=pl part is a query parameter, while introduction identifies a fragment of the document. The fragment is not sent to the server as part of the HTTP request; it is interpreted by software on the user’s side.
A URL does not guarantee that the resource exists or is accessible. The address may point to a deleted page, require a login or refer to a server that is not responding. It is still a URL.
What exactly is the difference?
The easiest way to remember the distinction is through two questions: a URI answers “what are we identifying?”, while a URL also tells us “where and how can we try to access it?”. These are not two separate, non-overlapping categories: a URL is a particular type of URI.
| Example | Type | What does it tell us? |
|---|---|---|
https://example.com/zdjecie.jpg | URL and URI | Specifies the image’s location and how to access it through HTTPS. |
urn:isbn:9780131103627 | A URI of the URN type | Identifies a publication without specifying its location online. |
A URN, or Uniform Resource Name, is a name-based identifier within a particular namespace. In the second example, that namespace is ISBN. You do not need to use URNs to understand website addresses, but they help explain why URI is not simply another word for URL.
A useful comparison is a book and its place on a shelf. An ISBN identifies a particular edition, while details of the library, bookcase and shelf help you find it. This is only an analogy: a web URL can both identify a resource and specify its location.
Which term should you use in practice?
If you are asking for a website address, a product link or a file address, use URL. It is precise in this context and does not require an explanation of the broader category of identifiers.
In technical documentation, you may encounter the term URI even when the example value looks like an ordinary HTTPS address. This is not necessarily a mistake: the author may be using the broader concept or the terminology adopted by a particular standard. If an API field is named redirect_uri, keep that exact name — do not change it to redirect_url just because you are passing a website address.
It is also worth distinguishing a complete address from its parts. On its own, example.com is a domain name, while /guide is a relative reference whose meaning depends on the base address. Neither provides the same information on its own as the complete URL https://example.com/guide.
Why are these terms sometimes used interchangeably?
The traditional classification of URI identifiers, which includes URL and URN, explains the basic distinction well. However, terminology is not entirely consistent across standards: the WHATWG URL standard, used in browsers, uses the term URL and defines its own rules for processing addresses.
When programming, the requirements of a particular library or API therefore matter more than the label itself: whether it accepts a complete address, whether it supports relative references and which schemes it allows. When filling in a “website address” field, provide a complete URL; when implementing an integration, check its documentation for the required format.
See also: What is FreeBSD?
