URI vs URL
This article explains the difference between a **URI (Uniform Resource Identifier)** and a **URL (Uniform Resource Locator)** — two terms that are often confused, misused, or presented as if they are fundamentally different. In reality: **a URL *is* a type of URI**. The URL adds one key piece: a **protocol/scheme that tells you how to access the resource**.
Context
- “URI vs URL” has been debated for decades — often unnecessarily. - The confusion mostly comes from evolving terminology. - Developers frequently say “URL” when they mean URI.
Core Concepts
What is a URI?
A URI identifies a resource by name, location, or both. Examples:
What is a URL?
A URL is a URI that tells you how to locate the resource. Example:
URI vs URL vs URN
| Term | Meaning | Locates? | Example |
|---|---|---|---|
| URI | Any identifier | Maybe | mailto:dex@pirho.net |
| URL | URI with protocol | Yes | https://pirho.net |
| URN | Permanent name | No | urn:isbn:1234567890 |
Practical Application
APIs
Endpoints are URIs, not necessarily URLs.
Browsers
Browsers resolve URLs but internally use URI references.
Common Pitfalls
- Thinking “URL” and “URI” are interchangeable. - Forgetting URLs require a scheme.
Design & Architecture Considerations
- Use URI terminology for API design.
- Use URL in user-facing documentation.
Troubleshooting & Diagnostics
Example URL breakdown:
https://pirho.net/articles/uri?draft=true#definitions
Related Topics
References
- RFC 3986 — Uniform Resource Identifier