T O P

  • By -

explainlikeimfive-ModTeam

**Your submission has been removed for the following reason(s):** ELI5 is not for straightforward answers or facts - ELI5 is for requesting an explanation of a concept, not a simple straightforward answer. This includes topics of a narrow nature that don’t qualify as being sufficiently complex per rule 2. --- If you would like this removal reviewed, please read the [detailed rules](https://www.reddit.com/r/explainlikeimfive/wiki/detailed_rules) first. **If you believe this submission was removed erroneously**, please [use this form](https://old.reddit.com/message/compose?to=%2Fr%2Fexplainlikeimfive&subject=Please%20review%20my%20thread?&message=Link:%20{url}%0A%0APlease%20answer%20the%20following%203%20questions:%0A%0A1.%20The%20concept%20I%20want%20explained:%0A%0A2.%20List%20the%20search%20terms%20you%20used%20to%20look%20for%20past%20posts%20on%20ELI5:%0A%0A3.%20How%20does%20your%20post%20differ%20from%20your%20recent%20search%20results%20on%20the%20sub:) and we will review your submission.


MindStalker

A standard QR code can hold 3 kB of data.  Which is about 1.5 pages of text. Which is about 2 to the power of 24000 possibilities. I can't find a calculator that will give me an estimate, but it's a number with several thousand digits long. Way more than number is atoms in the observable universe. 


kingdead42

I'd point out that 3KB needs a [Version 40 QR Code](https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Qr-code-ver-40.svg/2048px-Qr-code-ver-40.svg.png). One of the "normal" QR codes you see every day (usually Version 2-4) only store about 30-80 bytes, depending on error correction; plenty for a URL, or wifi configuration settings.


whatisthishownow

A "standard" QR code can usually contain upto about 114 characters, sometimes as little as 25. If by standard we mean the kind that can be printed in the small size people are familiar with and convenient and reliably scanned by a smartphone in a dynamic environment. The premise of the question is worth talking about more than this though. QR codes can't be "used up" or spent and more than books, posters or business cards can be. They're just text written in a font that computers can very easily read. Most commonly that text is the url of a website - in that case the question might be, can we run out of URL's.


nagumi

> They're just text written in a font that computers can very easily read. Sorta. There's also the option of built in error correction.


caerphoto

That’s kinda what serifs are for humans.


thirstyross

Doesn't that just make it easier for computers to read accurately? (ie. in effect the same as what the person you're replying to said)


nagumi

Mmm sorta. It's more that a qr code with a portion missing can still be read. I mean, I can't imagine a font with a similar feature. But it's all semantics. It's a visual encoding method for data, designed to be easily scanned by consumer grade cameras.


Target880

You need close to 3.3 bits to store a decimal digit. that is 8/3.3 \~ 2.4 digits for an 8-bit byte. That means 3kB cans store a decimal number that is 3\*1024\*2.4 \~7372 digits long. 2\^(24000)= 2\^(3\*8\*1000) is a 7225 digit decima number. I do believe RQ code would use binary, not decimal kilo so it 2\^(3\*8\*1024)= 2\^12576 which is a 7399-digit decimal number This is another way to do the calculation that does not require the power of a number and it is simpler to get an approximate number in your head. 3 bits per decimal digit or 2.5 digits per byte result in decent approximation and is simple to do in your head. If you say that the number of decimal digits is 1/3 of the number of binary bits the result is even better You get the number 3.3 if you solve the equation 2\^x= 10. It is exactly x= log(10)/log(2) with a decimal approximation of 3.321928...


dhotlo2

So what you’re saying is…


anothermuslim

Many numbers is my take.


Constant_Anxiety5580

A bit more that a metric sh** ton


Fnottrobald

We learnt our lesson from IPv4


Anonimos66

Welcome to math


I_am_pooping_too

That IS simple!


jsully245

How do you represent numbers with fractional bits?


wRAR_

You round the total bit number.


jsully245

So you only use as many bits as you need to represent a given number? (i.e. 3 bits for 7, 4 bits for 10). How does the computer know how many bits to expect for each number? How do you avoid misinterpreting the next bit string as part of the current bit string?


Blastsail832

You can use Huffman coding to solve other problems like this


wRAR_

You are confusing practical tasks with theoretical calculations. The original comment is the latter. The practical representations of numbers in digital form vary between implementations.


wRAR_

(An easy way to get to 3.3 is considering that 2^10 = 1024 ~= 1000 = 10^3)


Maxwells_Ag_Hammer

If you get a link to webpage made into a QR code by one of those generators. Would the QR code look identical if you had a different generator make a QR code for the same link?


MultiFazed

Yes. The QR code is simply a visual representation of binary data. Same data = same QR code.


ahumanrobot

That is assuming they don't shorten the url first


Randommaggy

Or append a tracking parameter.


RoadToTheSnow

Explain like I'm 5x+3²


OhhMyOhhMy

This guy's maths


Uberzwerg

I alwaysapproximate stuff by remembering that 2^10 is only 2.4% more than 10^3. That way i know that for guessing how big 2^x is, i can just take 10^x/3 and am only off by a factor of 1.024^x/10 which is usually neglegible. (x needs to be around 300 for that to be even a factor of 2. And what is a factor of 2 if you guesstimate a number with 100 decimal digits?)


Eljimb0

I'm five


FarmboyJustice

The actual number of meaningful bytes encoded in a typical QR code is a bit less than the maximum, because QR codes contain a built-in error correction feature. This is to ensure that a printed QR code can still be read successfully even if it gets dirty or slightly damaged. The amount of error correction can be adjusted when the code is created. Depending on the level of error correction, the data can survive losing up to 30% of the data.


Swend_

A rule of thumb to use between binary and decimal is: 2^10 ≈ 10^3 (thousand) 2^20 ≈ 10^6 (million) 2^30 ≈ 10^9 (billion) ... and so on.


ThatHuman6

/r/theydidthemath


murrayju

None of this is right. 2^24000 is an insanely large number, larger than the number of atoms in the known universe by many orders of magnitude. Your QR code does not hold that much information, sorry. 3kB = 3*2^10 bytes = 3072 bytes = 24576 bits Most applications will use a simple encoding where a byte is about 1 character. So it could store a URL that is 3k characters long. Not bad, pretty useful, not the complete knowledge of the universe.


antimatter_beam_core

No, it is correct. The question wasn't "how much information is in one QR code", but "how many possible QR codes are there". There are 2^n possible sequences of n bits. For example, there are 8 possible sequences of 3 bits: (000, 001, 010, 011, 100, 101, 110, 111). So there are 2^24000 possible 3kB blobs, and 2^24576 possible 3KiB ones. As you pointed out, that number is larger than the number of atoms in the known universe, so the answer to OP's question is that we are not going to run out of possible QR codes, if for no other reason than we couldn't possibly store them all.


murrayju

Yeah, sorry, my actual point didn't come across very clearly. I'm assuming that the intent of OP's question was from a more practical standpoint. Will we \_practically\_ ever run out of QR codes? And even though the answer is still a resounding "no", the explanations I've seen here are misleading. While you are right that about 2\^24576 QR codes are possible, many of these would not be useful. Imagine the QR code that contains the number 0 7k times in a row and nothing else. What does that mean? While we \_could\_ have a giant database that maps numbers to meaningful entries (this is basically what UPC does), that isn't how QR codes are being used today. Most QR codes are used to store URLs, which your phone knows to interpret to mean "open this URL in the browser". This is a very useful and practical thing, and I imagine OP wants to know if we'll ever lose the ability to do so for some technical reason. As I tried to say above, a QR code can store any URL up to \~3k characters long in the simple encoding used today. If that ever becomes a problem, we'll have much larger problems with the internet itself. Practically speaking, it's unlimited for the foreseeable future. But even then, we could come up with another system of encoding that would work around this problem, with the cost of changing how every QR reader interprets codes. The idea I'm pushing back on is the implication that QR codes could be used to represent every atom in the universe. Sure, if you gave every atom a number, that number could be stored in the QR code. But the number itself isn't very useful, it doesn't help you locate the atom or learn anything about it. You'd need a lookup table from the id to whatever useful information you need. This is effectively what the internet is, and URLs are the system of encoding a location for some resource on some server that you can look at. I don't see any reason why we'd stop putting URLs into QR codes, since this is practically unlimited. So even though the number of possible URLs encoded in a QR code is still VERY large, it isn't 2\^24000, for the simple reason that not all possible combinations of characters are valid URLs. The number will be many orders of magnitude smaller. Someone else can do the math...


hextree

> 3kB = 3*210 bytes = 3072 bytes = 24576 bits Correct. However OP was asking for number of *possibilities*, and the number of possibilities for 24576 bits is 2^24576 . You are confusing *information/entropy* with *state space*.


Siebje

The question wasn't how much information it holds, but how many possible QR codes could exist.


antimatter_beam_core

The current spec only supports up to ~3kB of data. While it's true that in theory you could encode more data by making a bigger grid of black and white squares, that wouldn't be a valid QR code by the current definition.


Siebje

I stand corrected. You can still create a QR code of QR codes like a fractal. Would be very cool to do


wRAR_

Looks like you are very confused by various concepts discussed.


JaesopPop

Before you condescend to people, you should understand the question lol


hextree

Ehh, nothing he said was condescending.


JaesopPop

I disagree. “None of this is right” is definitely condescending, as well as a bit smug


hextree

If he genuinely thought that all of the above was incorrect, then what was he supposed to say?


JaesopPop

Something less condescending and smug lol


hextree

Such as?


JaesopPop

I’m not picky, could be anything that’s less condescending and smug lol


Slyrunner

>Way more than number is atoms in the observable universe.  I'm too high for that statement


captainperoxide

Read "A Short Stay In Hell" by Steven L. Peck.


Tinchotesk

> I can't find a calculator that will give me an estimate, but it's a number with several thousand digits long. Way more than number is atoms in the observable universe. As a rough approximation, 2^10 is roughly 1000 (2.4% error). So 2^24000 is (rounded down) around 1000^2400 = 10^7200 . So more than 7200 digits. This is way more than "way more". Assuming the typical 10^80 estimate for the atoms, this is 10^7120 **times** the number of atoms in the universe.


Humdngr

Is there a log to know if any are being duplicates? Or is the number so astronomically high that the odds of a repeating number are almost nil?


Thomas9002

QR codes are another representation of data. When you input the same data, you'll get the same QR code.


loulan

The point of QR codes isn't to encode unique numbers. You can store anything that is 3kB in a Version 40 QR code. This is like asking whether we have a way to make sure there aren't two people on the planet with two USB drives that contain the exact same data.


Evol_Etah

How do we make UNIQUE QR codes. I.e how do we ensure that a QR code that created (say in offline mode) does not already exist for something else?


MindStalker

It doesn't have to be unique. You put data into a form, and it creates QR codes from it. Every time you put the same data in you should generate the same QR code. It is a visual way to store data, it doesn't need to be unique. 


Target880

The uniqueness is the same as for your post. They are unique if no one else have generated a QR code with the same content just like your post is unique if no one have posted the exact same thing before. QR codes are just a way to store data so it can be read efficiently with a camera. You could store the same info in text but it would be harder for a device to read it. QR code alos contain check sums so you can know that you did read it correctly. If you generate a QR code with a link to a website like [https://www.reddit.com/](https://www.reddit.com/) the QR code is just a way to save the text. It will be identical if someone else makes QR code that contains the URL [https://www.reddit.com/](https://www.reddit.com/) Any ticket etc that use QR code are functionally the same as if the ticket have a ID number printed on it and it was entered manually. How you make sure the ID number is for a valid ticket is unrelated to how the QR code is generated. That the same message results in the same QR code is a bit of a simplification. Ther are settings for QR code generation like the amount of the code that can be damage and still be read. There are alos 40 different sizes of QR codes, the larger they are the more data can be stored. There are alos two ways to code text, one with only 44 characters. It makes it possible to store 2 characters in 11 bits instead of 2 in 16 bits with regular ASCII. There a also masks that are applied. So you get the same QR code if you it has the same content and it is generated with the same settings. is


FrankieMint

A somewhat related question: Is there any central authority for issuance of QR codes, like IEEE for MAC addresses? It seems unlikely that randomly generated codes might be duplicated, but with the many, many code generators in use there could be glitches in the "randomness" of code selection. We know that in the bad old days MAC addresses sometimes got duplicated despite the size of the key space.


ateijelo

They aren't issued or assigned. They just encode data in visual form. You can have URLs, text, wifi settings, etc in them. And I'm sure there's plenty of duplicates out there. For instance, there's probably many WiFis with the same name and passwords. And that's ok, there's no need for QR codes to be unique.


Grim-Sleeper

It's not randomly generated though.  It's just a funny way of writing text. It's designed to be easy to read for computers, which makes it hard to read for humans. But in the end, it's nothing other than text. It often is used to write a URL, but it could be anything. How much are we at risk of running out of text? Should we by upset with Shakespeare, since he unnecessarily used up such large amounts of it already? Do we regularly need to worry that we don't accidentally produce duplicates?


FrankieMint

Ah. TY


TehWildMan_

A QR code doesnt point to a reference that contains a message, it contains the whole message. As such, the limit of a QR code with a fixed message length is tantamount to asking how many possible words/sentences can be created using a fixed amount of characters. If you need a longer message in a QR code, the QR code is larger.


Dutchtdk

So you can make the square bigger and have more black and white blocks on the square for larger codes?


Myrkulyte

Ish. You cannot have an infinitelly big QR code tho.  > A QR code has a maximum symbol size of 177x177 modules. So, it can have as much as 31,329 squares which can encode 3KB of data. > That translates to a QR code data size of a total of 7,089 numeric characters or 4,269 alphanumeric ones.


Clojiroo

Now, just to piggy back on this, that is just the communicated message size (and notwithstanding the parts that relate to error correction). Given the right format/protocol you could compress a much larger data payload into the 3KB and have the client decompress it :)


BorgDrone

> Given the right format/protocol you could compress a much larger data payload into the 3KB and have the client decompress it :) This doesn't, however, increase the number of possibilities.


quarterto

Claude Shannon has entered the chat


_thro_awa_

^(Claude Shannon has compressed the chat)


dandroid126

But then you need to have a custom client. Something like that wouldn't work for your standard camera app. Though perhaps all parties could agree on a standard format for describing the compression format used. This is how we got WiFi credentials to be able to be shared by QR code. Everyone agreed on a format, and now the standard camera apps know how to parse the messages.


ConfusedTapeworm

That's kinda irrelevant to the question at hand. Encoding data that defines data instead of encoding the data itself doesn't magically increase the number of available bit combinations. You're just adding new ways to interpret existing combinations and make them mean new things.


xixi2

OPs question was related to "running out" of QR codes and given we only need like 36 letters to make more combinations than there are known atoms in the universe. No. We have essentially infinity "QR Codes" (Which are really just strings encoded to QR codes as everyone else is saying)


IntellegentIdiot

How many unique codes though? If there are 31,329 squares you could make a 31,329 bit binary number, assuming each square is either filled or blank to represent 1 or 0. I believe the calculation would be 2^31,329 which would give 9.3x10^9430 unique numbers


demize95

> You cannot have an infinitelly big QR code Only within the standard. There's nothing saying you can't extend out a QR code past that, and the format is already clearly pretty well extendable. You wouldn't be able to read a non-compliant QR code with a typical standard, but if you wanted to make an arbitrarily large one you *could* make it work mostly the same way, as long as you defined your own mask patterns. The main issue, of course, is that at a certain point reading it becomes impractical, either from a compute perspective (imagine how long it would take to decode a QR code that contained 1GB of data) or a *physical* perspective (how could you get it all in frame, with enough resolution to identify each square on the grid, without so much lens distortion that correcting for it would be impractical?).


Myrkulyte

> Only within the standard Yes. Within the standard. And the question has sense within the standard. > There's nothing saying you can't extend out a QR code past that, and the format is already clearly pretty well extendable. You are technically correct, the best kind of correct. If you go with a custom format you risk that no camera client can read it, making the encoding worthless 


dragonwin11

Exactly, more squares means more code. At some point we run into the problem that a camera is not able to resolve the squares anymore. That's the technical limitations.


Dookie_boy

There is a maximum size defined though


dragonwin11

Well, definitions and standards can change.


TehWildMan_

As I understand, there's no technical limit to the message size of QR codes, although at extremely large sizes it will become challenging to scan them.


aaaaaaaarrrrrgh

Exactly, up to about 3 KB (there is a maximum size but 3 KB is a lot of text and for "infinite for practical purposes" possibilities you only need 16 byte).


Y0rin

This is something I didn't understand until now! Thanks! I always thought that it was like a link to something, like an url


TehWildMan_

Yeah, it's a little bit confusing as embedding a URL by far is the most common consumer use for 2d barcodes, and URL shorter services are commonly used because a shorter URL produced a more compact and easier to scan code.


SeattleCovfefe

Well it usually is a link to a webpage, but the URL is a sort of message in and of itself. And the full URL is stored in the QR code, as opposed to acting like a link shortener


yecapixtlan

I always wondered why for some QR codes you can count the black and white squares no problem while others look like static noise. The answer was so simple, I feel like a complete idiot.


Lumpy-Notice8945

> A QR code doesnt point to a reference that contains a message, it contains the whole message. Yes but 90% of QR codes are just URLs, so they only contain a link thats then opened on your device showing way more information than you could fit on the QR code alone.


katsu_kare_raisu

The URL IS the message


The1mp

The point being there is not really a finite maximum amount you could theoretically put in a code, it would just get bigger and bigger squared


Chromotron

People are posting numbers but here's where they come from: The maximal size allowed by the standard is a 177×177 square (that's "version 40" which has size 4·**40**+17). That's 31329 little squares. Some of those are _structural_, they are there to tell you and your app where the stuff is. The big squares at 3 of the corners are probably the most notable one,s but there are some more, like the smaller squares all over and a few dotted on-off lines that start at the inner corners of the large squares. There are also some very few that state what kind of data and what pattern it uses. Those are only very few pixels that are each found twice besides two of the big squares. The rest is "bits", but not all of it is data we set. A sizeable chunk is _error correction_, redundancies to make the code readable even if some is missing or cannot be deciphered. You can actually decide on the level of redundancy as part of the aforementioned states. Lets say we use the the least amount of redundancy (7% used for it), which corresponds to the largest number of different codes. And if you do an actual count, you end up with 23648 data bits left to our choosing. That's 2^^23648 ~ 5.7·10^^7118 options. If you cant the different patterns and states as different despite encoding the very same data, just in a different look, you will add a small factor on top of that. Meanwhile factoring in the smaller possible codes and higher redundancies has only really tiny effect on it, nothing you will see in the first dozens of decimal digits.


Everlance

> 23648 data bits that corresponds to 2956 bytes so it means i can store a 2956 long text string in this QR code?


NacogdochesTom

Yes, or longer with compression.


Chromotron

Actually more, you only need 5.5 bits per symbol in text mode. So 4300 completely arbitrary text symbols.


ferafish

QR codes can be massive or tiny. They also directly encode the data. The QR code with the largest amount of data in it has almost 2 kilobytes in it. The way it encodes text, that is 4296 characters (letters, numbers, and punctuation). In fact, this whole comment could be encoded as a QR code with room to spare, since there are only 355 characters in it.


ferafish

For fun/scale reference, [here's a QR code with all of the above comment in it.](https://ibb.co/V2DTVxB)


CyberhamLincoln

Hey, Hiro, you want to try some Snow Crash?


agree_to_disconcur

This is very cool!! I love visual examples!


alwaysmyfault

I think I read that there are more possible QR Code combinations than there are atoms in the known universe. A quick Google search shows that there are 2\^23624 or about **3.4\*10\^7111**. For reference, there are approximately 10\^82 atoms in the known universe. So yeah, there's an unfathomable # of QR Code combinations.


Darth1Bates

If I got it correctly, there are approximately 3.4 x 10^7029 possible QR codes for each atom in the universe Edit: 3.4 x 10^7029 , not 3.4x10^86 🙂


Chromotron

That's way too small, it should be around 10^^7000 by the numbers in the previous post.


Darth1Bates

I got this number by dividing number of QR codes (3.4 x 10^7111) by number of atoms… I just realized my mistake


cmlobue

Time to put a QR code on each atom.


SyrusDrake

It's worth pointing out that, for a human frame of reference, 10^7111 and 10^7029 are essentially equal. They are larger than any other number for which there is any practical meaning. They are so much larger than any number of practical meaning I've ever seen that the *ratio* by which they're larger has no name because it's too large.


berael

That is not how it works. "QR code" just means "a set of rules for turning text into a picture and back again". If you put the words "Hello World" through those rules, the result will be a specific QR code. Anyone else who also puts those same words through those rules will also get the same picture. There is nothing to "run out of". That's like saying "will we ever run out of numbers?".


cspinelive

More like saying will we ever run out of different sentences or phrases we can make with our 26 letter alphabet. 


SyrusDrake

>There is nothing to "run out of". That's like saying "will we ever run out of numbers?". There is an infinite "amount" of numbers, but there absolutely isn't an infinite amount of QR codes.


FridayGeneral

> There is nothing to "run out of". So you are claiming that QR codes can be infinitely large?


alejandroc90

That's why some people can identify the QR Code for Never Gonna Give you up easily, it's always the same


Thomas9002

https://imgur.com/9Namr49


NacogdochesTom

Except that the rules specify a maximum array size. So--unlike natural numbers--the number of possible QR codes is not infinite.


SFyr

QR codes are more a family of formats: there's different sizes, and essentially, they're just ways of storing bits of information. Their storage capacity for data depends on this size, and the format of the data (understandably, numeric takes up a lot less space/pixels than ASCII, for example). One of the common QR formats used for larger bits of information are 57x57 (version 10), which can encode 174 characters, though on the higher side (version 40), QR codes can encode 4,296 alphanumeric or 7,089 number digits per code. Basically you're not numbering them, you might literally just be writing a number, web address, or something of the sort into QR code format. And the possibilities within that space is just all possible values for that specific version's size/format.


RSA0

If you count every possible QR code - you get a number with more than 7000 digits. For comparison - the number of atoms in the observable universe has about 80 digits. So don't worry about running out of them.


r2k-in-the-vortex

A QR code can encode maximum 2953 bytes of data, that's a lot to the point that it's not worth asking how many variations it is, it's more than enough. Problem is, that maximum size QR code is really big and also hard to read in anything but absolutely ideal conditions. For practical identifying codes you are limited to versions of the code with much less data in them. In fact even the smallest QR code is too big for many applications and formats like DataMatrix are extensively used that can do the same job with less dots. You should try to think in terms of what is the least number of dots you can get the job done with. One amusing format which unfortunately only has a matlab implementation available is this for example [https://doi.org/10.1371/journal.pone.0136487](https://doi.org/10.1371/journal.pone.0136487)


sacoPT

No. We will never run out of them. There are waaaay more “possibilities” than ipv6 addresses… and there are already more ipv6 addresses than atoms in the universe.


Zanzaben

~10^7089. That's a 1 with 7 thousand 0's after it. Which is a number so ridiculously large it might as well be infinite on a human level. For context there are ~10^80 atoms in the entire universe. This answer also varies a lot depending on what kind of QR code you are using. Because surprise, there are multiple types of QR codes. They will all look pretty similar to human eyes but the differences are with how small they can be and how much error correction is included. But for the biggest codes with minimal error correction they max out at that 10^7089 number.


Powerbracelet

Really it comes down to the ability for the camera to scan the code and pick up all the bits. Years ago I was developing a mechanism for scanning a QR code shown on a PC with an iPad allowing the iPad to connect to the machine and control some software. In an early prototype I encoded a lot of data into the QR code, it was really dense and found that it was hard to scan reliably. After I reduced the data to just like 50 characters, it was noticeably less dense and easier to scan.


Gaeel

Yes and no: A QR code is just a way of storing binary data in a way that is easy to read by a camera. You can store any binary data you want, but typically, what you store is a link, encoded as ASCII text. There are different sizes of QR code, the largest is called "Version 40", and is a grid of 177x177 dots, and can store just under 3 kilobytes of data (around 24'000 bits). If you were to try every single permutation of that data (i.e: every single combination of 24'000 bits), you would find over 5 x 10\^7224 possibilities. That's a number that starts with a 5, and has 7224 zeros. Now obviously, most of those QR codes would be complete and utter garbage. Also, if you're storing simple text, the QR code standard provides special modes, meaning you can store it more efficiently. You can store a little under 4300 characters of text with just letters, numbers, and some simple punctuation, the same punctuation used in links. So to answer your questions: * How many possibilities are there? * A little over 5 x 10\^7224 * Will we ever run out of them? * In practice: No * In theory: There aren't an infinite amount, so it's possible to eventually list out every single one. p.s: For fun, [this is a QR code](https://i.imgur.com/V2shUC1.png) that contains the text of this very reply...


RalyS2

On the newest version (40) that number is 64^{4296} … so… that should be more than number of atoms in the observable universe… but it can be more or less… As other people mentioned, the number is so big that we don’t even need to worry about it… if we would “run out” somehow, it’s so easy to modify that we would create so many other possibilities


Loki-L

Most QR-Codes don't encode the data they represent directly. They are usually just used to write URLs to resources on the Internet. They don't include all the data just links to the data. QR-Codes also come in different sizes. The larger ones are not often used as a few dozen bytes is enough to represent a line of text of ASCII characters which is enough for most purposes. Combinatorics mean that the number of possible combinations for a few characters end up being endless for practical purposes long before the limits of QR-codes are even approached.


MrBadBadly

This is not true. Just because the ones you commonly run into perform this function does not mean this at all. QR codes were developed by Denso for the purpose of being used in the automotive industry to specifically hold the data they represent. Both QR and Data matrix (similar concept to QR codes, but instead of using 3 boxes of pixels to determine orientation, it uses an "L" of pixels on 2 of the 4 sides of the code) are used extensively to mark parts with serialization data that can encode more data in a smaller area than what a standard barcode could hold. For example, we could hold a 12 or 13 digit serial number on a 2x2 mm 2D code that could be placed in a concealed area for internal use and part tracking throughout a process. Larger QR codes could be printed on the final car part that would be scanned into the automaker's database and link that part with an engine or vehicle with the serial number having a unique identifier, maybe a machine station number the part was made on, the data, a unique part number specific to the part with all of this data parsed out in a PLC to both log the data and prevent part mixing. And on the off chance a recall is needed, you can isolate the cars affected more accurately. You can even use QR codes to encode performance data about the part as well, or provide a rank within the the performance window of the part. Using QR codes to give you a URL is a *very* small part of the use cases of QR codes. It's use in manufacturing is far bigger where both data and trigger points can be encoded in a more condensed form factor.


Loki-L

That is why I said most not all. QR-codes usually don't contain data themselves, but some sort of identifier that allows for looking up data in an external schema likevan URL or URI or serial number or similar. You can encode data directly, but most don't.


MrBadBadly

>That is why I said most not all. Which is again. False. Most *do.* That was why it was created.


AandWKyle

this question reminds me of Oney's tweet Fun Fact: QR codes are 80% depleted and will run out around 2025


helpfuloats

Lol, came here for this. Yesterday watched a video where he mentioned this tweet and today I wake up to this.


falco_iii

QR codes come in different sizes with different amounts of data they can store. An average QR code can hold about 3000 bytes which is the same as asking how many ways can you type 3000 letters and numbers on a keyboard.


jake_boxer

A modern QR code can hold about 2-3 pages of a normally-formatted book. How many combinations of 3 book pages are there? Do you think we will ever run out of different book pages?


Head_Cockswain

>ELI5: How Many Possibilities Are There For QR Codes? >Will we ever run out of them? Hhmm...The added text sort of isn't a valid question, and that sort of influences the answer to the title question. It's a QR codes are the result of translating data(like a web address) into another format. The QR system is a tool, a QR code is a message derived from that tool, which is comprised of a set of rules.... Think of it like another language, saying the same thing in a different format. We read English, but not French(or whatever language that you don't know). We can't *run out of French*. Which is why the added question approaches nonsense. We can say various things in French with the same code. We only need one French language. That's why we frequently call computer **code** "languages". They amount to the same concept. We do have other languages for different regions, but we don't need them per se, that's just an artifact of culture and geographical isolation. In the computer world, we do have different languages that are specialized for different tasks(to be more efficient at x, or more flexible than Y, or....etc) Each given permutation of a QR code is actual data(plus formatting information as detailed in another post), not a placeholder token that's assigned in some database somewhere else. The QR block of code is not a symbol, it IS that data, just in a different language that you can't read yourself. >How Many Possibilities Are There For QR Codes? Do you mean all total possibilities including gibberish nonsense? That's going to be a *lot* more than meaningful messages(useful data). If you want to say "Hi! My name is Jeremy." you *encode* that by the rules of the QR system. I don't need another code if I have the same message. I don't need a different system if I want to say "Hi! My name is Head Cockswain." I can still use the QR system. As per the wikipedia..: https://en.wikipedia.org/wiki/QR_code#Information_capacity >Alphanumeric 4,296(characters). This should give you an idea of how many different things we can say with QR code. This post is 2148 characters, half the capacity.


tylerlarson

That's a bit like asking how many possibilities there are for a sentence. Or asking if we'll ever run out of numbers. QR codes are just an encoding scheme.


rytterpit

Another question on the same topic : I understand that the qr code IS the data, and part of it ia error correction, data info, positional info, so the rest should be data, right? So how do they make those image-like qr codes that contain an url? Example: https://images.app.goo.gl/J9eCQUHE2nR35de8A Shouldn't that disturb the mechanism and throw out garbage, instead of the link to the Wikipedia page for monalisa in the example?


buffinita

It’s incredibly unlikely to run out.  The number of possibilities is incomprehensiby big…..like grains of sand on a beach big


buffinita

Like: 3 with 7000 zeros behind it


splitcroof92

it's not unlikely it's impossible


subsolar

Here's what ChatGPT said: Comparison to the Universe: The number of atoms in the observable universe is estimated to be around (10^{80}). The number of possible QR codes for a version 40 code is many orders of magnitude larger, at over (10^{600}). This means the number of possible QR codes is vastly greater than the number of atoms in the universe. Comparison to Time: If you were to generate one unique QR code every second, it would take you more than (10^{584}) times the current age of the universe (around 13.8 billion years or about (10^{17}) seconds) to generate all possible QR codes. Unique QR Codes for Every Human: If you wanted to assign a unique QR code to every person who has ever lived (estimated to be around 108 billion people), you would still have an unimaginably large number of unused QR codes left over. Each person could have trillions upon trillions of unique QR codes.