URL vs URI vs URN Explained with Examples and Cheat Sheet

When working with the web, terms like URL, URI, and URN often cause confusion. While they sound similar, each has a specific meaning.

1.URL (Uniform Resource Locator)

A URL is a subtype of URI that not only identifies a resource but also provides the location and a way to access it (via protocol, domain, path, etc.).

Example:

http://www.mysite.com:80/path/to/mypage.html?product=camera#SomewhereInDoc

2. URI (Uniform Resource Identifier)

A URI is a generic identifier used to name or locate a resource. It is the umbrella term that covers both URLs and URNs.

Example: mailto:[email protected]

3. URN (Uniform Resource Name)

A URN is another subtype of URI that identifies a resource by name within a namespace but doesn’t provide its location.

Example: urn:isbn:123456


👉 In short:

URI = Identifier (generic)

URL = Identifier + Locator

URN = Identifier + Name

This cheat sheet makes it simple: URL and URN are both URIs, but they serve different purposes.

URL vs URI vs URN – Explained with Cheat Sheet

No comments:

Powered by Blogger.