Home › Blog ›
Ambiguous Characters in Password Generation: Why 1/l/I and 0
Security Engineering
🔍 Ambiguous Characters in Password Generation: Why 1/l/I and 0/O Confuse Users
By Ateeq Y Tanoli, · 1 June 2026 · 3 min read · 0 words
Avoiding ambiguous characters is just one part of user-friendly password generation. Using a password manager like Bitwarden eliminates the need to manually type passwords altogether, making character ambiguity a non-issue.
Ambiguous Characters in Password Generation: Why 1/l/I and 0/O Cause Trouble
Every password generator faces a quiet design decision that most users never notice until something goes wrong: whether to include characters that look nearly identical to one another. The lowercase letter "l", the uppercase letter "I", and the digit "1" can be visually indistinguishable depending on the font. The digit "0" and the uppercase letter "O" suffer from the same problem, as do less obvious pairs like the digit "5" and the letter "S", or "8" and "B". These are collectively known as ambiguous characters, and the choice to exclude them is one of the most practical usability features a strong password generator can offer.
What Exactly Makes a Character Ambiguous
A character is considered ambiguous when its rendered glyph closely resembles that of another character in the same character set. The problem is fundamentally about visual perception rather than about the underlying data. To a computer, "1" (Unicode U+0031) and "l" (U+006C) are entirely different values with different binary representations. There is no technical confusion at the machine level. The confusion is entirely human and entirely dependent on typography.
The most commonly flagged ambiguous characters include the following:
The digit 1, the lowercase l, and the uppercase I
The digit 0 and the uppercase letter O (and sometimes lowercase o)
The digit 5 and the uppercase S
The digit 8 and the uppercase B
The digit 2 and the uppercase Z
The lowercase rn sequence, which can resemble the letter m
The vertical bar |, which competes with 1, l, and I
Whether two characters are confusable depends heavily on the typeface being used. In a font with serifs, the uppercase "I" gains distinctive top and bottom strokes that separate it clearly from a plain vertical "l" or "1". In a monospaced coding font, the digit "0" is frequently drawn with a slash or a dot in the center precisely to disambiguate it from the letter "O". But a password is not displayed in a controlled environment. It might appear in a sans-serif system font on a phone, a serif font in a printed document, or a sticky note written by hand, where the ambiguity becomes even worse.
Why This Matters for Passwords Specifically
Passwords are a uniquely hostile context for ambiguous characters because of how they are used. A password is, by design, a random or pseudo-random string with no semantic meaning. When you read ordinary text and encounter an ambiguous glyph, your brain resolves it using context. If you see "He11o" you instantly know it should be "Hello" because the word makes sense and the digits do not. There is no such safety net in a password. The string "Il1O0o" carries no internal logic that would let a reader self-correct a misread character.
This becomes a real problem in several common scenarios:
Manual transcription. A user reads a password from one screen and types it into another device, or copies it from a printed credential sheet. Each ambiguous character is an opportunity for error.
Reading aloud. Someone dictates a password over the phone to a colleague or to technical support. "Is that a one or a lowercase L?" becomes a frustrating and time-consuming clarification.
Handwriting. Wi-Fi passwords, temporary credentials, and recovery codes are often written by hand on paper or a whiteboard, where the writer's penmanship multiplies the ambiguity.
Optical character recognition. When a password is photographed or scanned and processed by OCR software, ambiguous characters are among the most frequently misidentified.
Each of these failures produces the same outcome: a lockout. The user is certain they typed the correct password, the system rejects it, and after several attempts the account may be temporarily locked or the credential discarded entirely. This erodes trust in the password generator and, paradoxically, can push users toward weaker, more memorable passwords that they choose themselves.
The Security Trade-Off of Excluding Characters
Removing ambiguous characters from the available pool does reduce the total number of possible characters, which in turn slightly reduces the entropy contributed by each character position. Entropy is the mathematical measure of password strength, expressed in bits, and it is calculated from the size of the character set and the length of the password. Shrinking the character set lowers the per-character entropy.
Consider a full character set. A typical alphanumeric pool with mixed case and digits contains 62 characters: 26 lowercase, 26 uppercase, and 10 digits. Each character of a random password drawn from this set contributes roughly 5.95 bits of entropy, since the base-2 logarithm of 62 is about 5.95. If you exclude the most common ambiguous characters, you might remove perhaps eight characters, leaving a pool of 54. The per-character entropy drops to about 5.75 bits, the base-2 logarithm of 54.
The crucial insight is that this loss is small and easily recovered. The difference between 5.95 and 5.75 bits per character is roughly 0.2 bits. Over a sixteen-character password, that amounts to about 3.2 bits of total entropy lost. You can compensate completely by adding a single additional character to the password length, since each new position adds another 5.75 bits. In other words, a seventeen-character password from the reduced set is stronger than a sixteen-character password from the full set. The usability benefit is enormous and the security cost is trivial when length is even marginally increased.
Full set (62 chars): approximately 5.95 bits per character
Reduced set (54 chars): approximately 5.75 bits per character
Recovery strategy: add one or two characters to the password length
Best Practices for Implementation
A well-designed password generator should treat ambiguous-character exclusion as an optional setting rather than a forced behavior, because the right choice depends on how the password will be used. For a password destined to live only inside a password manager and be filled automatically by software, the visual ambiguity is irrelevant, and the full character set should be used to maximize entropy. For a password that a human will read, type, dictate, or write down, exclusion is strongly preferable.
Several principles guide a thoughtful implementation:
Make it a toggle. Offer "exclude ambiguous characters" as a clearly labeled checkbox, defaulting to the option that matches the expected use case.
Document the set. Tell users exactly which characters are removed so they understand the behavior and can audit it.
Compensate with length. When exclusion is enabled, consider nudging the default length slightly higher to offset the entropy reduction.
Preserve true randomness. Exclusion should remove characters from the pool before selection, never filter them out afterward in a way that biases the distribution.
Ultimately, the question of whether to include 1, l, I, 0, and O is a microcosm of good security design as a whole. The strongest password is worthless if a human cannot reliably enter it, and the most usable system is dangerous if it sacrifices meaningful security. By understanding that ambiguous-character exclusion costs almost nothing in entropy while preventing a genuine and common class of human error, designers can offer a feature that respects both the mathematics of cryptographic strength and the realities of how people actually handle their credentials.
We use cookies to improve your experience. Learn more