URI And URL Difference

Before going into URL and URI,

you need to know some background. Do you ever thought about, who decides what is URL? and what is URI? or who is the authority for URL, URI and such naming conventions?

W3C and IETF

There are two separate bodies W3C and IETF. The World Wide Web Consortium (W3C) is the main international standards organization for the World Wide Web. The specifications for URI and URL are defined by W3C.

It was founded and headed by Sir Tim Berners-Lee. He is one of the greatest scientist living now. He created this www model of server and client architecture, a web server serving web pages through network and client browsers reading it. He did it first when he was with CERN. He created the world’s first web page http://info.cern.ch/ . He was also in HTML 2.0 working group of IETF. So it is very appropriate for W3C to define URI and URL.

Internet Engineering Task Force (IETF) is an open international community working on Internet related standards. In general it addresses issues of Internet protocols.

In particular W3C defines the web, html specifications and related information. IETF defines IP, TCP, or DNS, for security at any of these levels; with SMTP or NNTP protocols.

So the stake for definition for URI and URL is with W3C. But as there is only a thin line between these organisation’s work they tend to cross each other. In some place IETF gives dissimilar definition for URL and URI.

If you read through the huge volume of journals available in web for this topic, you can sense that experts :-( are using URI and URL synonymously. Which is causing all these confusion among the web community about URI, URL and URN.

URI

An URI identifies a resource. It is a locator. It includes a URI scheme, authority, path, query and fragment by syntax. For example, http: is a URI scheme.

Syntax of URI based on RFC 3986

foo://example.com:8042/over/there?name=ferret#nose
\_/ \______________/\_________/ \_________/ \__/
| | | | |
scheme authority path query fragment
| _____________________|__
/ \ / \
urn:example:animal:ferret:nose

URL

The term “Uniform Resource Locator” (URL) refers to the subset of URIs that, in addition to identifying a resource, provide a means of locating the resource by describing its primary access mechanism (e.g., its network “location”).

URN

The term “Uniform Resource Name” (URN) is used to identify a resource independent of its location. Example urn:ISBN:1-23-432536-5

Summary of differences between URI and URL

Whenever you have a doubt that, whether something is a URL or URI then use URI as a term to identify it. Since URI is a super set of URL.

This Servlet tutorial was added on 07/10/2009.

Comments on "URI And URL Difference" Tutorial:

  1. ch raja ramesh says:

    thank you very much to give me this url. it is very usefull to our students i will give this url to all of my students.

  2. Chetan says:

    Thank u for this info….

  3. M.NADEEN says:

    thanks it is realy usefull 4 student

  4. vinay says:

    thank u…………

  5. Hiten says:

    Hi,
    This URL is indeed wonderful as I came to know about one of the fact about the first web Page.
    Will keep looking for more updates in the future like these.

    Regards
    Hiten

  6. Babai says:

    thnx

  7. navin chaitanya says:

    Thanks a lot Joseph my confusion about URL,URI,URN
    has been cleared after going thro this blog
    Keep up the good work!!!

  8. sandy says:

    you are a genious….i have never seen such kind of easy understandable site..plz plz update info in your blog..plz plz

  9. Geet says:

    Well said.. keep up the good work. Thanks

  10. chandru says:

    But these two things are not explained clearly…. i have still confusing both uri and url…. please clarify this doubt….

  11. Manthan says:

    Will u plz clarify this in deep

  12. Rag says:

    b.getBMenthod()

  13. K.SAINATH REDDY says:

    Thanks for giving information.try to give briefly information like this.
    what is URL,purpose of it?
    what is URI,purpose of it?
    whats the diff of them?

    URL URI
    1.
    2.
    3.

    Thanks & Regards
    k.sainath

  14. Ranga , RKMPTC says:

    This page is easy understood for our students. It have very simply answer. Please diffenciate with table format.

  15. saretth says:

    thanku shakthimaan

  16. Anonymous says:

    thank u shakthimaaan

  17. renju says:

    thanks dis info

  18. vijay says:

    its very helpful

  19. Irfan says:

    Thanks Joe for explaining the terms clearly in very simple and easy ways, clear my doubts.

  20. Rishi jhunjhunwala says:

    Sir URI stands for uniform resource identifier..

  21. sandhya says:

    Hi Joe,
    Your information is really usefull.I want to know about how post method sends the data to the server in request message body.please help me in this regard.

  22. Anonymous says:

    Hi Joe,

    I was wondering if you would consider showing tutorial material on Java for Android. Clearly,there is a plethora of material on the Internet… but not necessarily high-quality material.

  23. Joe says:

    Recently I have been working on Android and I will try my best to post some articles on it soon.

  24. subha says:

    Hi,

    Can you say an example for URI & URL

  25. chandra says:

    Thsnks for giving this info about uri and url aswellas urn.I got fully confident what is what on that but a small doubt on that is uri is only before location resource.right? then Is url a after uri scheme location commes under url.

  26. raaj says:

    liitle but bit satisfactory

  27. sriram says:

    it is so nic. thank u

  28. Anonymous says:

    good decription.Thanks

  29. nikita says:

    thanks

  30. John says:

    thanks

  31. bhaskar says:

    thank u
    nice explanation of uri and url

  32. Anonymous says:

    Hi Joe

    Nice explanation difference between URI and URL.

    Nageshwar

  33. Anonymous says:

    Hi Joe

    Nice explanation difference between URI and URL.

    Nageshwar

  34. SURABHE says:

    foo://example.com:8042/over/there?name=ferret#nose
    \_/ \______________/\_________/ \_________/ \__/
    | | | | |
    scheme authority path query fragment
    | _____________________|__
    / \ / \
    urn:example:animal:ferret:nose

    SORRY SIR BUT I DINT UNDERSTAND THIS CSAN U PLEASE HELP ME WITH THIS I NEED TO GIVE A PRESENTATION IN COLLEGE! NEED TO EXPLAIN THE URI CONCEPT!

  35. vanita says:

    Thanks for the info and i need more and more

  36. Yuvaraj says:

    Joe, Will u please take some simple example to differentiate URI, URL and URN?
    Thanks in advance.

  37. Idrees says:

    Can u please explain it more through example…

    kindly mail me

  38. Bala says:

    yes, it’s nice.

  39. Vinitha says:

    nice.. but give better example for URL and URN. I mean one realtime website example

  40. Rupinder Kaur says:

    URI- Uniform resource Identifier is a superset of URL and URN
    e.g.- files/sales/report.html
    is not a URL because it does not specify how to retrieve the resource.

    URL – specifies how to retrieve the resource

    URN- e.g. ISBN:1-9211009-59 is a URN because it uniquely identifies this book.

  41. poonam says:

    thanx

  42. Piyush says:

    Really Nice one. It helped me.
    Thanks

  43. kartheek says:

    excellent man, u have done it…… great job….

  44. KG says:

    @Divya I love your reply that make sense asking the right questions folks baga chepparu

  45. Roma says:

    If URI is super set of URL then how come it got this:

    URI : /XXX/abc.do
    URL : http://localhost:9083/XXX/abc.do

    When i write the below code:

    System.out.println(“URI : “+ httpRequestObj.getRequestURI());

    System.out.println(“URL : “+ httpRequestObj.getRequestURL());

    Please explain sir. Thanks in advance.

  46. bhaskar says:

    Hi
    Thank you Joe, really i have impressed.

    Thanks
    Bhaskar

  47. AMAN KUMAR MISHRA says:

    Really knowledgable site

  48. Anonymous says:

    thnx its really helpfull

  49. Pratik Palkar says:

    Thank you very much for such a great info

  50. srivas says:

    thanks,it helped me a lot.

  51. bbbb says:

    pls give answer to above comment of Roma it will also help me

  52. bbbb says:

    pls give answer to above comment of Roma it will also help me

  53. jone says:

    thank you very much !!you let me know that difference between the URI and URL……

  54. Anonymous says:

    better explain with an example..
    like

    url=
    uri=
    urn=

    an example always explain more, than no.of pages

  55. jaspreet says:

    thank yu sir for providing information

  56. Niranjan says:

    thank u Mr.Joe it is more helpful to me can u pls provide like ppts and digramatically with examples in prgm,real life also it is easly helpful to us

  57. Niranjan says:

    pls kindly mail to me joe with examples and ppts

  58. venu says:

    thank you very much sir !!

  59. Anonymous says:

    NIce explanation

  60. Anonymous says:

    thanks Joe great work

  61. Anonymous says:

    Hi Joe,

    Nice explanation and examples.

    Could you please reffer me the the book/source of information.

    Thanks,
    Neelkant

  62. bia says:

    thanks alot it clearfies my problm

  63. bia says:

    thanks alottttt

  64. prakash says:

    can i call a uri as a interface………….

  65. raj says:

    thanks

  66. gorityala ramana says:

    you didnot give the example to identify the url ,uri and urn

  67. G.Palanikumar says:

    Respected Sir,

    How to run more servlet program without changing web.xml file and also how to set path permanently to run servlet?

  68. kuntal chakrabarti says:

    Fantastic … Can you please explain URN in details?

  69. Anonymous says:

    I felt chills when I read about Sir Tim Berners-Lee. Good info job. Thnx

  70. Naveen Shriyan says:

    Thanks a lot….

  71. Java Jobs in India says:

    Excellent!!! Information Joe. Thank you

  72. Shishupal Shakya says:

    great sir………

  73. kaarthik says:

    Nice… but it could be even better with more examples

  74. Jayant says:

    Nice explanation Mr.Joe but it will be more clear if done along with some examples.

  75. rangana says:

    useful article … thanks a lot…

  76. SREEKANTH says:

    Good.But some confusion

Comments are closed for this "URI And URL Difference" tutorial.