Maximum length for url in chrome browser

91,752

Solution 1

I believe it's stayed the same:

I could not find any limits on Chrome and Safari. Both are based on WebKit and it seems to have similar limits as Firefox has.

Firefox stops displaying after 64k characters, but can serve more than 100k characters.

you can read more about it in this article.

Generally speaking there is no "limit" to a URL's length, but this answer states that you should keep your URL's under 2048 chars regardless to make sure it works in every client and server.

More information about all browsers here.

Solution 2

The current limit in Chrome is 2MB. This issue is discussed here:

https://code.google.com/p/chromium/issues/detail?id=69227

You'll find resources there such as a workaround when you need to overcome the issue for things such as displaying an image with a "toDataUrl" source.

Solution 3

Besides the fact that handling a URL might be implementation-dependent, the HTTP/1.1 specifications states in the RFC2616 that :

RFC 2616 (Hypertext Transfer Protocol — HTTP/1.1) states in section 3.2.1 that there is no limit to the length of an URI (URI is the official term for what most people call a URL).

I do not know how many maximum characters would be, at maximum, be accepted by Google Chrome, and don't even know if there currently exists such a limit. Perhaps would it be specified in an obscure define in the Chromium GIT repository or even specified by the maximum value of a text input in the Win32 API on windows for example.

However there is a limit on most web servers regarding URL lengths. They will probably in most cases throw a 413 Entity Too Large in response.

Share:
91,752

Related videos on Youtube

omer schleifer
Author by

omer schleifer

Updated on July 09, 2022

Comments

  • omer schleifer
    omer schleifer almost 2 years

    I have seen this popular question:

    What is the maximum length of a URL in different browsers?

    But since I couldn't find a reference to Google Chrome directly (and since most answers were given a few years ago) I was wondering what is the current limitation of URL length for the Google Chrome browser?

  • chriz
    chriz almost 10 years
    @SteveCampbell better?
  • callum
    callum over 9 years
    This still doesn't answer the question, the quote on the site is about Firefox not Chrome, and it doesn't make sense.
  • chriz
    chriz over 9 years
    @callum A quote from the site: "I could not find any limits on Chrome and Safari. Both are based on WebKit and it seems to have similar limits as FireFox has."
  • callum
    callum over 9 years
    Right, but in your answer you quoted a line about Firefox
  • chriz
    chriz over 9 years
    ... because it is the same as Chrome
  • heisian
    heisian over 8 years
    firefox is branched from mozilla, while chrome and safari are branched from webkit. but they are definitely more similar to each other than I.E. so @chriz is pretty spot on. I think we can usually assume I.E. will always be lagging in terms of "luxury" features.
  • alexkb
    alexkb almost 3 years
    2MB is equivalent to 2,097,152 characters, which is quite different to the length on the accepted answers on the other thread (2,000 characters).
  • Adam Katz
    Adam Katz about 2 years
    That threat says 2MB may be the limit with respect to serializing data, which appears to be a reference to the data URI scheme (as in a uniform resource identifier) rather than an actual HTTP(S) URL (as in a uniform resource location, a subset of URIs). The referenced answer says that as of January 2021, Chrome's limit is 32779 in the location bar and >64k in document.location or an anchor tag.