What is the character limit on URL [duplicate]

What is the character limit for a URL, especially if the URL is formed from a GET method of a form.


Solution 1:

According to Microsoft it's 2048. Since they invented the internet (and also the light, the darkness and Linux) they are right. :-) .... or.. and since IE forces this lower value, it's the lowest common denominator.

http://support.microsoft.com/kb/208427

Under Firefox, I see people on the net reporting URLs of 0xFFFF working: http://forums.mozillazine.org/viewtopic.php?f=38&t=155648&start=0&st=0&sk=t&sd=a

Here is another post which talks about this: http://hiox.org/index.php?id=425


EDIT: this is very sad that almost 5 years after I wrote this answer - it is still true. If you can, look at the history of this answer.

EDIT2: I found a better answer on StackOverflow - What is the maximum length of a URL in different browsers?

EDIT3: 9 years after - Explorer is deprecated in favor of Edge, Edge soon to be re-designed using Blink (making it very close to Chrome). I wonder how relevant this answer is.

Solution 2:

Explanation

There is no thumb rule made for the maximum URL size of HTTP Get Request as per RFC 2616 (Hypertext Transfer Protocol — HTTP/1.1 – Section 3.2.1).

Limits are imposed by various browsers and respective servers.
These limits must be considered collectively while passing the query string passed in the URL in any of the HTTP Requests.

If the URL size exceeds the URL Size limit imposed by the respective browser, the request will not be passed to the server & unnecessary effort will be required to debug & handle this situation.


Maximum URL Size By...

Browser

  1. Internet Explorer

    2048 B

    Microsoft Internet Explorer has a maximum uniform resource locator (URL) length of 2,083 characters. Internet Explorer also has a maximum path length of 2,048 characters. This limit applies to both POST request and GET request URLs.If you are using the GET method, you are limited to a maximum of 2,048 characters, minus the number of characters in the actual path.

  2. Mozilla Firefox

    100 KB

    The address bar doesn’t shows any characters beyond 65,536 characters. But the URL size can be more than that, though you cannot view it in the address bar. This holds for FireFox 1.5 up until the current FireFox version

  3. Opera

    200 KB

    The URL is completely visible in the address bar even at such a big range

  4. Chrome,Safari

    100 KB

    Both browsers are webkit based and seems to have almost same limit as firefox


Server

  1. Apache

    128 KB

    The size is changed using the LimitRequestLine setting of the server

  2. IIS

    16 KB

    Default value is 16 KB and maximum limit is 16 MB

  3. Lotus Notes

    4 KB


Further Information

Very long URLs are not recommended at all.
For a web based application to be cross browser compatible, the Get Method must not be used for passing very long strings, containing more than 2000 characters.

If you are facing a situation where you need to use URLs to contain huge number of characters, then give it another thought.