What is the character limit for a URL, especially if the URL is formed from a GET method of a form.
-
3Interesting question, had never thought about it – Robert Gould Jun 26 '09 at 22:12
-
21Dont do it. Dont encode huge amounts of data in your URLs. – Sanjaya R Jun 26 '09 at 22:13
-
Github writes their issue label filters into the URL. Although unlikely, that can end up filling the URL limit. I consider that a correct use of url params. – Archonic Mar 31 '14 at 22:36
-
Note that if you are looking for a limit a user can send URL to the server (e.g. a limit for the URL in access logs) then you can find the answer here (because max URL is less then max headers): http://stackoverflow.com/questions/686217/maximum-on-http-header-values – Nux Dec 08 '16 at 08:53
4 Answers
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.

- 8,948
- 9
- 47
- 69
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
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.
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
Opera
200 KB
The URL is completely visible in the address bar even at such a big range
Chrome,Safari
100 KB
Both browsers are webkit based and seems to have almost same limit as firefox
Server
Apache
128 KB
The size is changed using the LimitRequestLine setting of the server
IIS
16 KB
Default value is 16 KB and maximum limit is 16 MB
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.

- 9,803
- 4
- 36
- 52
Newer IE: 2048 characters Some platforms support only 255.

- 52,691
- 28
- 123
- 168
-
8Knowing which platforms you mean would be helpful, as I was under the impression that IE (@ 2048 chars) supports the lowest URL length of all the popular browsers / platforms...:) – Mathew Jun 26 '09 at 23:47
-
@MatW What about phones and tablets...? not sure, looking for this info myself... – DMin Apr 09 '12 at 13:48
Different browsers have different limits. But generally the limit is around 2,000 characters for the GET method of a URL. You can use a proxy page that does a POST method (if your API supports it) and that has a larger limit of 5,000 characters. We are currently investigating using a proxy page with the Google Map API as we have crashed into the 2,000 character limit.

- 219
- 2
- 7