Measuring password strength in bits
For a randomly generated password, strength is measured as entropy: length multiplied by the base-2 logarithm of the number of possible characters. Each extra bit doubles the number of guesses an attacker needs in the worst case.
This generator draws from 26 uppercase letters, 26 lowercase letters, 10 digits and 26 symbols, a pool of 88 characters when everything is ticked. Each character is chosen independently using the browser's crypto.getRandomValues, discarding the few random values that would make some characters slightly more likely than others. A first password is generated as soon as the page loads.
- 16 characters from all 88: about 103.4 bits.
- 16 characters, letters and digits only (62): about 95.3 bits.
- 18 characters, letters and digits only: about 107.2 bits, stronger than 16 with symbols.
- 12 characters from all 88: about 77.5 bits.
- 8 lowercase letters: about 37.6 bits, which is weak against offline guessing.
Length beats complexity
As the figures show, two extra characters add more strength than switching on symbols. That is useful when a site rejects certain symbols: turn them off and add length instead.
Current US guidance in NIST SP 800-63B reflects this. It favours longer passwords, discourages forced composition rules and routine expiry, and recommends checking new passwords against lists of known breached ones. The practical setup is a password manager holding a unique random password for every account, with one long passphrase you can type to unlock it.
Because characters are drawn independently, a generated password will occasionally lack one of the selected types, such as a digit. If a site insists on one of each, generate again.
How a QR code stores data
QR codes are defined by ISO/IEC 18004. The square grid comes in 40 versions, from 21 x 21 modules for version 1 up to 177 x 177 for version 40, and the encoder picks the smallest version that fits your text. The three large squares in the corners are finder patterns that let a camera locate and straighten the code.
Reed-Solomon error correction lets a damaged code still be read. There are four levels, L, M, Q and H, which recover roughly 7, 15, 25 and 30 percent of the code respectively. The library used here defaults to level M, a reasonable balance between density and resilience.
A static QR code holds the text itself, so a link, a contact card or a Wi-Fi login is read directly from the image. A Wi-Fi code uses the format WIFI:T:WPA;S:NetworkName;P:password;; and any semicolon, comma, colon or backslash in the name or password should be escaped with a backslash.
Making a code that scans reliably
Scanners look for strong contrast between modules and background. In this generator the background is always white and the modules default to black, the arrangement every scanner expects. You can change the module colour, but keep it dark; light or mid-tone modules on white reduce contrast and some scanners will fail. Test with more than one phone before printing.
The PNG is 300 pixels wide and includes the four-module quiet zone the specification calls for. Leave clear space around the code when you place it in a design. For print, a common rule of thumb is that the scanning distance should be no more than about ten times the code's width, so a 2 cm code suits a business card read from arm's length but not a poster across a room.
Password & QR Code Studio: frequently asked questions
How long should a random password be?
For accounts stored in a password manager, 16 or more random characters is a sound default and costs you nothing to type. For a password you must remember, a passphrase of several random words is easier to recall at similar strength. Never reuse a password across sites, whatever its length.
Can a QR code contain a virus?
The code itself is only text and cannot run anything. The risk is where it sends you: a malicious link to a fake login page or a harmful download, a scam often called quishing. Check the URL your camera previews before opening it, especially on stickers in public places.
How much data can a QR code hold?
The largest version at the lowest error correction level holds up to 7,089 digits, 4,296 uppercase alphanumeric characters or 2,953 bytes of other data. More data means a denser grid with smaller modules, which is harder to scan, so keep links short.
Why won't my QR code scan?
The usual causes are low contrast between modules and background, a light module colour, too little blank margin once the code is placed in a design, a code printed too small for the viewing distance, or glare on glossy material. Test the final printed version, not just the screen preview.
Is it safe to share a Wi-Fi password as a QR code?
It is convenient for guests, but anyone who photographs the code can read the password from it. Use it for a separate guest network rather than your main one, and avoid posting it where strangers can see it.