Menu

Difference Between
URL vs URI.

URL vs URI vs URN

Jon Volks
Written By | @webproninja

Have you ever wondered what the difference was between URL vs URI vs URN? The sad truth is, unless you’re talking to an internet savvy person, most people will always use the three interchangeably. But if you still want to know the difference, keep on reading.

First, lets take a look at all the different elements of a web address.

http://www.domain.com/page.html?query=1#anchor
Communication Protocol | Hostname | Path to Resource | Query String | Anchor

In the examples below I’m going to reference HTTP protocol but it also applies to the other ones as well.

URL vs URI vs URN

URL vs URI vs URN

Image provided by Wikipedia.

URI (Uniform Resource Identifier)

The URI is a way to identify a point of content on the world wide web. This could be text, video, sound, image or a program. It is the entire web address that includes communication protocol, hostname, path to resource, query string and anchor.

Example:
http://www.domain.com/page.html?query=1#anchor

URL (Uniform Resource Locator)

URL is the unique address for a file that is accessible by the internet. It includes the communications protocol, hostname and path to resource.

Example:
http://www.domain.com/page.html?query=1#anchor

URN (Uniform Resource Name)

URN is an internet resource with a name that has a persistent significance, meaning the owner of the URN can expect that someone else (or a program) will always be able to find a resource. It includes the hostname, path to resource, query string and anchors.

Example:
http://www.domain.com/page.html?query=1#anchor

In conclusion, URI encompasses the entire web address with both URL and URN incorporated within it. URL is the unique address for a resource where URN is a unique name for a resource. Not that you’re all caught up on URL vs URI vs URN, you can start showing off at parties and educate all your friends. Tell us how this went in the comments below.

The More You Know

Tags: , ,

About The Author

Jonathan Volks is currently a Web Programmer at Skidmore College in Upstate New York. He enjoys everything about the Internet; from Search Engine Optimization to Web Programming. His hobbies include landscape photography and hiking the Adirondacks.

Leave a Reply

Your email address will not be published. Required fields are marked *