What is the maximum length of a URL in different browsers? Does it differ between browsers?
Does the HTTP protocol dictate it?
|
What is the maximum length of a URL in different browsers? Does it differ between browsers? Does the HTTP protocol dictate it? |
||||
| show 2 more comments |
Short answer - de facto limit of 2000 charactersIf you keep URLs under 2000 characters, they'll work in virtually any combination of client and server software. Longer answer - first, the standards...RFC 2616 (Hypertext Transfer Protocol HTTP/1.1) section 3.2.1 says
...and the realityThat's what the standards say. For the reality, see this research over at boutell.com to see what individual browser and server implementations will support. It's worth a read, but the executive summary is:
Search engines like URLs < 2048 chars...Be aware that the sitemaps protocol, which allows a site to inform search engines about available pages, has a limit of 2048 characters in a URL. If you intend to use sitemaps, a limit has been decided for you! (see Calin-Andrei Burloiu's answer below) There's also some research from 2010 into the maximum URL length that search engines will crawl and index. They found the limit was 2047 chars, which appears allied to the sitemap protocol spec. However, they also found the Google SERP tool wouldn't cope with URLs longer than 1855 chars. Internet Explorer's limitations...IE8's maximum URL length is 2083 chars, and it seems IE9 has a similar limit. I've tested IE10 and the address bar will only accept 2083 chars. You can click a URL which is longer than this, but the address bar will still only show 2083 characters of this link. Is this information up to date?This is a popular question, and as the original research is nearly 6 years old I'll try to keep it up to date: As of July 2013, the advice still stands, as the IE10 address bar will still not accept a longer URL. | |||||||||||||||||||||
|
|
WWW FAQs: What is the maximum length of a URL? has its own answer based on empirical testing and research. The short answer is that going over 2048 characters makes Internet Explorer unhappy and thus this is the limit you should use. See the page for a long answer. | ||||
|
|
|
The longest URLs I came across are data URLs Example image URL from Google image results (11747 characters)
| |||||||||||||||||
|
|
The URI RFC (of which URLs are a subset) doesn't define a maximum length, however, it does recommend that the hostname part of the URI (if applicable) not exceed 255 characters in length:
As noted in other posts though, some browsers have a practical limitation on the length of a URL. | |||
|
|
|
There is really no universal maximum URL length. The max length is determined only by what the client browser chooses to support, which varies widely. The 2,083 limit is only present in Internet Explorer (all versions up to 7.0). The max length in Firefox and Safari seems to be unlimited, although instability occurs with URLs reaching around 65,000 characters. Opera seems to have no max URL length whatsoever, and doesn't suffer instability at extremely long lengths. | |||||||||
|
|
The HTTP 1.1 specification says:
As mentioned by @Brian, the HTTP clients (e.g. browsers) may have their own limits, and HTTP servers will have different limits. | |||
|
|
|
Microsoft Support says "Maximum URL length is 2,083 characters in Internet Explorer". IE has problems with URLs longer than that. Firefox seems to work fine with >4k chars. | |||||||||||||||||||||
|
|
Sitemaps protocol which is a way for webmasters to inform search engines about pages on their sites (also used by Google in Webmaster Tools) supports URLs with less than 2048 characters. So if you are planning to use this feature for Search Engine Optimization take this into account. | |||
|
|
|
In URL as UI Jakob Nielsen recommends:
This is not the maximum but I'd consider this a practical maximum if you want your URL to be shared. | |||
|
|
|
ASP.net 2 and SQL Server reporting services 2005 have a limit of 2028. I found this out the hard way, where my dynamic URL generator would not pass over some parameters to a report beyond that point. This was under IE8. | |||
|
|
|
Limit request line directive sets the maximum length of a URL. By default, it is set to 8190, which gives you a lot of room. However other servers and some browses, limit the length more. Because all parameters are passed on the URL line,items that were in password of hidden fields will also be displayed in the URL of course. Neither mobile should be used for real security measures and should be considered cosmetic security at best..... | |||
|
|
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.
MapPathfor actual file names. One hopes that the extra-long url names are not paired with extra-long file paths, since the latter results in an unusable mess whereas the former may just be a developer abusing get requests where he should be using post requests. – Brian Feb 18 at 12:41