How Many URLs Exist?
Edited Feb 8, 2026 | Posted Jun 7, 2025 | ~11 minute read
An incredible combinatorial explosion appears when you try to compute the number of unique URLs that can exist. In fact, RFC 3986 doesn't impose any finite limit on the length of a valid URL. So, in theory, the real number might be countably infinite. Yet, there are physical limitations that make the real number finite in practice. The purpose of this note is not to compute that exact finite number, but to give you a tiny hint at how unfathomably large that number might be, even given the strictest limitations.
There are far, far, far more possible URLs than there are particles in the known universe. To compute the "exact" cardinality we'd need to settle a lot of questions, iterate over every applicable protocol, and learn every one of those protocols' unique rules. Then we'd have to settle questions. In this note, I've gone factor-by-factor and, at each step, I've chosen the simplest possible case in order to reduce the set down into one whose size we can compute with a simple exponent.
Worst-Case Length Limit
Do we limit our URLs to two thousand characters like Internet Explorer or two million like Chrome? To answer that, its worth considering that many servers, social media platforms and databases impose limits of their own on shared link size. For the most part, characters seems to be the worst-case length limit.
Yet, since some modern browsers like Chrome really can process much longer URLs, its worth noting that imposing this limit just removed a lot of potential URLs from the "true" set. In fact, we just removed . However, there's still a lot of URLs (and a lot of nuance) left in our miniscule .
No Protocol Mutability
There are many different schemes to choose from. While the IANA registry lists all registered Uniform Resource Identifier (URI) schemes, URLs are technically a subset of URIs that specify a location and access method for a resource (e.g., http, ftp, file, mailto). However, we're going to forget about those and limit ourselves to only https. This leaves us with only a fraction of the original set, but the impact of this is almost nothing compared to the length limit we imposed at the start. Speaking of which, we can go ahead and subtract the 8 characters in "https://" from our -character limit, leaving us with only usable characters.
Worst Possible Host
What about the host (a.k.a. the domain name)? The number of possible domain names is, by itself, vastly larger than the number of particles in the known universe. As a rough estimate, we can look at the maximum length of a domain name (including dots), which is characters. The vast majority of "potential" domain names are characters in length and have as few dots as possible. Each domain label can use the digits 0-9, the lowercase letters a-z and the dash (a total of characters). Although there are some rules about when and how you can use these characters, the impact of those rules is pretty small compared to the impact of the -character length limit. We can estimate that there are roughly domain names.
This estimate covers IPv4 addresses as well as domain names. Yet, the variable length of domain names and the ability to have IPv6 addresses presents us with added complications. Given our length limit, shorter hosts leave us with more space for other URL components whereas longer ones consume that space. Accounting for that in a cardinality computation is far from trivial. Let's get crazy and pick the worst possible domain name and then limit our set to only those URLs that use that domain name:
this.domain.name.is.made.from.two-hundred-fifty-three.characters.which.means.that.it.is.just.about.as.long.as.it.can.possibly.be.abcdefghijklmnopqrstuvwxyz.it.includes.the.alphabet.just.to.take.up.some.more.letters.abcdefghijklmnopqrstuvwxyz.example.com
We just removed of the possible hosts. Because the shortest hosts correspond to most -character URLs, the percent of actual URLs we just removed (from our already miniscule set) has even more 9s. Since this domain takes up of our characters, we are left with only .
No Fancy Features
There's still a lot of unpredictability in what those characters might be. For example, we could include user credentials (a universe of its own), a specific port (a number between and ), an untold variety of query parameters, and a whole universe of possible hash fragments, all of which increase the size of our set, but their impact is actually pretty negligible compared to the impact of our length limit and giant domain name. They also add an incredible amount of complexity to the equation.
They're all optional, so let's just remove them from consideration for today, and only include URLs that have none of these features.
No Variable-length Pathnames
At this point, there's only one URL structure we haven't removed from the equation: the pathname. Counting the size of our set is really just counting the number of valid pathnames up to characters long. There is only one URL in our set that doesn't have a pathname and all other URLs contain at least the initial slash that separates the domain name from the rest of the path, making that first character unusable.
The variable-length of pathnames increases our set size a little bit compared to the set with all -character-long pathnames. To find out exactly how much, we'd have to take one (for the empty path) plus one (for the path "/") plus the number of -character pathnames plus the number of -character ones and so on. That requires a geometric series. That's too rich for our worst-case set (and the increase it provides is actually negligible as the vast majority of URLs in our set are going to be those whose pathnames that already have exactly characters). Let's just remove every URL whose pathname is not exactly characters long.
If we assume about allowed characters in the pathname, we really only removed of our URLs.
No Special Characters
I hinted at the fact that modern browsers support characters in a URL pathname. Let's have a look:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 - . _ ~ ! $ & ' ( ) * + , ; = : @ / %
This makes it seem like it would be possible to use base to compute the cardinality of our remaining set.
There's just one problem: some sequences of these characters are not valid in a URL. Broadly accounting for those invalid sequences (especially the special rules regarding the % symbol) gives us a base closer to meaning we could almost say that our set has about URLs in it.
Yet, despite being valid, some of these characters can trip up URL parsers and platforms that embed links. So, let's lighten our load and remove a bunch more URLs from our set! Let's only consider URLs that use the following -character alphabet to spell out their pathname segments:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 - _
I wish I could tell you that this reduces our set to of the base- set but that's not how it works on this exponential scale. An estimated of the base- set had at least one of the special characters we removed, leaving us with .
No Variable-length Segments
We can't just string together base- characters together and call it a day. As mentioned, the first symbol must be a slash. Furthermore, some systems throw an error if it encounters a single pathname segment longer than characters. To get to , the pathname must have at least slashes. It wouldn't be terribly hard to account for these arrangements but it would mean writing out some geometric series. So, let's only count URLs that have the following exact arrangement: fixed-length segments (-character segments followed by -character segment). This uses exactly slashes, leaving us with characters, only of which can actually change from one URL to the next.
Finally, we have a set of completely valid URLs whose exact cardinality can be known. Just for fun, here is a "random" (but valid) URL from that set:
https://this.domain.name.is.made.from.two-hundred-fifty-three.characters.which.means.that.it.is.just.about.as.long.as.it.can.possibly.be.abcdefghijklmnopqrstuvwxyz.it.includes.the.alphabet.just.to.take.up.some.more.letters.abcdefghijklmnopqrstuvwxyz.example.com/ld9370LC9uzp83Mklv90dujd9v7774n0V7p7em5078B7S790dkb094977au9D07B098yAV76ouyf79J7uft7d5f77g90jki98765dc7hkji7865d7dgy77yuhjkIk8Kgf567hj9ny7GVNjn7677V9jbvr567bj099efbn49efg776ft5x4rxi7T8Yoih0n7hv6r4d657d8g9u8b779ub8yf7t7d75d674s77743s2a1a7772zqzdtcuhbi/007opkolpp7m777ko7n777ou77h8yvtcr7tds5es5241awzsx7dfchvj7jkhboi78g8765c6e4x421s576y57t6fv8iub9ub87ytvc64dc768fv897b9ub9yv7tc7tv8ybhvutF64d52as2zfxcghvbhininIonoi0ih9ubgiI0P1MS07vmllp0097f74d2wa1asswextyvunimlljo00987643212wzqz1a12aswzz23sxerc34dfcrvr/5fvtby65g67buh7nu98m09k0,00k9jubyuhubvtctvubuvtdcrd4dxw23314152375786e6d976f70867f97743d8742a13s7278rf97vtiyfcdtd7xtrwSte7wrxztewzyrTUCtivuyvbOUyv77utrs462s67546rv9vbyv8rtc6X4s13A2ezwrexrcYdexwa2WESDfgtyu789iujhnmko9iujhbVFdre321qasxcfvghuiuytr432was/zxcvfghyui9o876543wsaxcdfghyuI9Oijnjiuygtftdrezwertrytfugyhiu8978gtf7r6d53s64512zwxetCRYtfughioYG87f564dsetrcyvubhij9i8u7t6f5r7743217aqwezsxdcrft7gyh77ujikJHgt5432177777qwertyhj7kJHgre321qaszxcvghjio987654321QWErfcv7bhuyTRfdfgtyui987654321qwerfv77798/bnhjHGv7fghjio09oiujhn7b7VCxsaq12we7rty7u8Ikj7hgFD777seRTyu876YT7r4ewsDFghJiuy6543721Qas7zxcVBnjio9876574321qasDFGhbnJUytrfdsERtyuJHgbvfdeRthBVGCFdsw34543212qaszxcVbghjkio0987654321qasZXcvbnhJKo0987654ERD7sw21qas7ZXcfghyuI9O0okmjki87uyhgbvgt54edsxzsa/Q12qwasXCfrt56tygBnhjio909OIKjmnko09iujhY76tfgcder321q7aszxCvgbhjui7uY6T5r4e321234567879i8UytrfdsXcvbghjIuyTRewqA7SzxcvbgHJik7oKjmjI7UyhgfrEwszx7sAWaszxcdftYUijkmjNHBGfrtYuiuYTredFCghyui89876543eDfgyuytr43edfgyuhbghJUI987654321qaszxCVghui9o876543wErt/fGHYBUtcu63s312asydu6IYUTYVbokuvhtExt42at4wrexcutyvbo8ygoiyrc53yr3254Sdu6rfvoyboiybiutyvyuCtycurc6u5c865777ctycuyut7ityd7i6757DE7U7674s5u74s54sd7xry7txc7jyrfxd7j7yrDujdI7775edu77564st427as13szr7ezUT7rxiYGCkyuC77FJut7ykm79OM0p7978tx9
It's exactly characters long. It has a giant (but syntactically valid) domain name. It has a very unlikely (but still valid) pathname. And I mashed my keyboard as fast as I could to make it. It still took a surprisingly long time to type it out, which gives you some idea of just how many URLs of this limited form exist.
Final Cardinality of our Set
Before we look at the actual number, let's consider the scale of everything. This set is truly a mindbogglingly miniscule fraction of a fraction of a fraction of a fraction of a fraction of a fraction of a fraction of the set of valid URLs that can actually be used in practice. It's not a drop in the bucket, it's not even a subatomic particle in the bucket. But it is trivial to measure the size of it: .
For reference, there are "only" an estimated particles in the known universe (including photons, neutrinos, and relativistic particles), a number which looks something like this:
1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
The ratio of that () to the size of our mindbogglingly miniscule fraction () is basically . But what does look like? See for yourself:
201240292591446336002975358748886087407709404701257259073998076001435757712375232073099557959093033061492023162811187482946680727829043045527715105729025026045887946144499943466163942545981809716622625281622984342312963870991153553838760591113240247842580856226022599220103287602055551445669348201263084550541745186917990455552115441315723787028095753334282822242976424331945346297646040611061790365235579307329996928389591231213688140203877931114365631589634607073943333637642579773109746098505116322319061651931187942542952982340987900086678428129118365347565579442277368800504020976455273386491553140110675961828494805821890979591403484022408790873335186924833810020757125532138026990755919340605746468537512415546705961100853805739008719521722770629538235550578475925361670927987839115607166789919964842276301908861396762644775346768956821868295434178128205720819891540754613904980845324307766860705538616560787826945354199334681537106602366986831502319885469301312151285680985357215963934302701133343757640805794067646907001265545414043975252720851118989843826954141588257966386552043533059863387361437868999014922613514446085863723230066648040485326481824596930415582821164015843023225167237174257094845760139826029028877044587114593734282194660687753700343568042902919706353723079877859317344282005568431622074401222352919120255271883855452217884210981200753027498064607426021472041472431980345699984855924833648827398356779559176213080377250967250437359584505605269633328477406258043172782075242672577563333988233572456672828308783038156128342392452054165096000211952102867176010519368535993887379130398103653711516472042124028719697136684021784058432672630132560891183778209098699670720678997690196776581927668318299632669458098053825992216521095671106493765276801024761044502350287004074977866603817269531151887416036170314741327751036493485491395899175140881938704518770458801774683111510327021155091958051071750836048604454493280009358537332794988912768128309883263120460219851637594441439350520626005701078493224533082315630197265481622647232052495681734346120137593884459487296822248239431894733141171404665085016964567384609713783180172773838031860848926159269754639459310676173352537576227561007212441721546229861877916706687077425977697573464309202629578109920748717060350859383868499942201765485206795690225436560622999166199700156471259860219135938574490012817123728187504640561920187423923379829555080967965417006320466316782964958618429602383116290689998708780126519252382346732256145417698310895869455244739684340968118712011033201153935714604412669817121697237180958745645812590593999854073553209499693005626196959198113659485245866672252328939138280193620824153354425238558460313919887398944460670807392657923539379231969680494041030511701182691969202765253839208135652478674916943337709264477226588033322905464324674441988499879733018511522995866056581038300900614413405437209965776735362805988363465638980600015036290053928395977232633515690656885441348219760605831617069596195319366914786266115990303866933966502407908660854944935164965455874435907206922780338743089639681792003060813778530873320144896
That's a lot of URLs. The hartley entropy of our set is . This tells us exactly how much information content any one of these URLs conveys.
Extending to the Larger Set
Realistically, URLs that are 2MB cannot reliably be shared (even if they might work in a chromium browser). Still, let's imagine that they could be share and let's also imagine that URLs can have between one and data-storing characters and that each of these is one of possible URL-safe symbols. This is a massive oversimplification but it might get us into the ballpark. It also requires a geometric series, which we'll go ahead and compute. This larger set contains URLs, which can also be written as .
This evaluates to approximately . This is too big to compute and definitely too big to show you and if I did show it to you, it would have over three million digits.
Conclusion
Thanks for reading. I realize these estimates might not be as satisfying as knowing the exact number of valid URLs. Computing that number would be a massive undertaking and require more assumptions and math than I'm prepared to do in this humble notebook. Still, I hope that the ones we did count gives you some idea of how stupendously large the real number might be.
EJ's Notebook - How Many URLs Exist?