URL Length: how long can a URL be?

The URL length measures the number of characters that a URL consists of. The maximum length of a URL depends on the software used. You are on the safe side if you use a URL length of 2,083 characters or less.

The length of the URL indicates how many characters are contained within a URL. For example, the URL of our homepage (https://www.sistrix.com/) has 24 characters.

However, dynamically created URLs that combine several GET parameters or include user input in the URL can make URLs significantly longer. In this article, we’ll show you when this can become a problem.

How long can my URL be?

Official Internet standards are defined in so-called RFC documents (Request for Comments). RFC 2616 (Hypertext Transfer Protocol HTTP/1.1), which is responsible for URLs, does not specify the maximum URL length:

“The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs.”

RFC 2616 – Hypertext Transfer Protocol – HTTP/1.1

However, software developers make their own decisions when implementing this standard. In practice, URLs are limited in length depending on the combination of web server and web browser.

What is the maximum URL length for popular browsers?

The following maximum URL lengths apply to commonly used browsers. Since all of these browsers have a substantial market share, website operators have to stick to the lowest common denominator and limit their URLs to 2,083 characters in length.

Microsoft Internet Explorer: 2,083 characters
Microsoft Edge: 2,083 characters
Google Chrome: 32,779 characters
Mozilla Firefox: more than 64,000 characters
Apple Safari: more than 64,000 characters
Google Android: 8,192 characters

What is the maximum URL length for web servers and CDNs?

There are also restrictions on the maximum length of URLs, which are set by web servers and content delivery networks (CDNs). However, these can usually be adjusted: as a website operator, you can influence this value, whereas this is not the case with web browsers.

Apache: 8,177 characters
NGINX: 4,096 characters
Microsoft IIS: 16,384 characters
Fastly (CDN): 8,192 characters
Amazon CloudFront (CDN): 8,192 characters
Cloudflare (CDN): 32,768 characters

Since these values are all above the maximum 2,083 characters specified by the Microsoft Internet Explorer and Edge browsers, they have no effect on the maximum URL length in practice.

URLs in XML sitemaps: maximum of 2,048 characters?

The XML sitemap format for submitting URLs to search engines is relevant when it comes to search engine optimisation. The official documentation specifies a maximum length of 2,048 characters for the <loc> element, which is used to submit URLs:

“URL of the page. This URL must begin with the protocol (e.g. “http”) and end with a trailing slash if required by the web server. This value must not exceed 2,048 characters.”

– Sitemaps XML format, sitemaps.org

Longer URLs can cause the XML sitemap to become invalid, and search engines may then disregard the sitemap as a consequence.

How does Google deal with (very) long URLs?

Google does not make any public or binding statements on the maximum length of URLs. However, John Mueller pointed out in 2014 in the Webmaster Help Forum, in a typical Google response, that a length of less than 2,000 characters helps to keep things manageable.

In a Webmaster Hangout from 2019, John Mueller advised that URLs should be a maximum of 1,000 characters in length, otherwise problems could arise. However, he did not go into further detail about the specific problems.

Is the URL length a ranking factor?

No, the length of URLs has no direct influence on how well or how badly a page is ranked by Google.

However, there can be indirect consequences of using very long URLs: they are not passed on and linked to as often as shorter URLs, which are easier to remember. Fewer external links can thus (indirectly) lead to a poorer ranking.

It is also the case that very long and complex URLs change frequently when changes are made to the underlying CMS. These URL changes can also have a negative impact on rankings.

Steve Paine
27.03.2024