URI vs URL: what’s the difference?
A URI identifies a resource; a URL is a URI that also tells you how to reach it — a scheme like https: plus a location. So every URL is a URI, but not every URI is a URL. In everyday web work the two words mean the same thing.
The short answer
| URI | URL | URN | |
|---|---|---|---|
| Stands for | Uniform Resource Identifier | Uniform Resource Locator | Uniform Resource Name |
| What it does | Identifies a resource | Identifies it and says where/how to get it | Names it permanently, independent of location |
| Example | any of these | https://example.com/a?b=1 | urn:isbn:9780131103627 |
| Relationship | The umbrella term | A kind of URI | A kind of URI |
What the standard says
RFC 3986, the URI specification, defines URI as the general syntax. Section 1.1.3 explains that “URL” refers to the subset of URIs that, in addition to identifying a resource, provide a means of locating it by describing its primary access mechanism — such as its network location. “URN” historically meant identifiers that stay globally unique and persistent even after the resource is gone, and today refers to URIs under the urn: scheme.
The same section says “A URI can be further classified as a locator, a name, or both” — a scheme isn’t locked into one role — and recommends that new specifications use the general term “URI” rather than “URL” or “URN”. In practice, the distinction is about how an identifier is used, not a hard line in the syntax.
Examples, sorted
https://example.com/docs?page=2#intro— a URL (and a URI): the scheme and host say how and where to fetch it.ftp://ftp.example.org/file.txt— a URL.mailto:alex@example.com— a URI; often called a URL because it tells your mail program what to do.urn:isbn:9780131103627— a URN: it names a book edition, not where to get a copy./docs/page.htmlor../img/logo.png— a relative reference. Neither a full URI nor a URL until it is resolved against a base address.
Why everyone just says “URL” now
The WHATWG URL Standard — the specification browsers actually implement — lists among its goals: “Standardize on the term URL. URI and IRI are just confusing.” Its reasoning is that a single parsing algorithm is used for both, so keeping them distinct doesn’t help anyone. It also aims to align RFC 3986 and RFC 3987 with what browsers really do and to obsolete them in the process. That is why JavaScript has a URL object, not a URI one.
Which word should you use?
- On the web, in docs and in front-end code: say URL. Browsers, MDN and the WHATWG do.
- When an API or spec says URI: follow it. Java has both
java.net.URI(parsing and building identifiers) andjava.net.URL(opening connections); OAuth calls itredirect_uri; REST guidelines talk about resource URIs. - For names that must outlive any location (ISBNs, standards, namespace identifiers): URN.
Same encoding rules
Whatever you call it, percent-encoding works the same: reserved characters are encoded when they are data and non-ASCII text is encoded as UTF-8. See the URL encoding table or try the decoder.
Sources & standards
- RFC 3986 §1.1.3 — URI, URL, and URN. rfc-editor.org/rfc/rfc3986#section-1.1.3
- RFC 8141 — Uniform Resource Names. rfc-editor.org/rfc/rfc8141
- WHATWG URL Standard — Goals. url.spec.whatwg.org/#goals
- Java java.net.URI — its class documentation explains the URI/URL distinction in Java.
Common questions.
Yes. A URL is a URI that also describes how to locate the resource, so every URL is a URI. The reverse isn’t true: a URN like urn:isbn:… is a URI but not a URL.
It is a URI. It’s commonly called a URL because it tells software how to act on it (send an email), and the WHATWG standard simply calls everything a URL.
A Uniform Resource Name: a URI under the urn: scheme that names something permanently, independent of where it is — for example urn:isbn:9780131103627 for a book edition.
Either is understood. Use whichever the surrounding standard uses — OAuth says redirect_uri, browsers and JavaScript say URL — and be consistent.
No. Both follow RFC 3986 percent-encoding: reserved characters are encoded when they are data, and non-ASCII characters are encoded as UTF-8 bytes.
More from the toolkit.
More guides
About this page. Written and maintained by Sri Murugan Systems, the developer of urlencodedecode.com. Definitions follow RFC 3986 §1.1.3, RFC 8141 and the WHATWG URL Standard.