system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5 : How does a QR / Bar-code work?
gpt
this is actually two different questions. bar codes work much different from QR codes.

bar code: 

consider the number 12345, we represent each of those numbers "1" "2" "3" etc using arabic numerals, which work fine for us but confuse computers. so we made a representation that can be easily understood by a computer, a series of alternating black and white lines. each number has a set of black and white lines that make it up. that's it, really just another way to represent the numbers you see written below it (the UPC)

a QR code is a bit more complicated as it represents arbitrary data.

so imagine the letters "QR" in binary (using utf8) this would look like 0011001100110100

take each of those 1's and make them a black box and each 0 as a white box. that's the basic principal behind a QR. now you may think (but QR codes are so much more complicated than that) it's true. just putting those on the page would be very error prone, what if it's upside down, what if it's at an angle, what if there is an odd light, what if one of the boxes is damaged. so we need to be able to account for these things.

what QR does is it places boxes in the corner so the reader can get a sense of the scale and orientation, it places an alternating set of black and white boxes between them to get an idea of the size of the boxes and adjust for odd lighting, it creates redundant copies of the data in the data field to recover from scratches or other damage to the QR and a checksum to check that the data is correct.

most of the complexities of QR and of barcodes come from error checking and allowing for scanning at odd angles.