52

For example, an image upload site that gives you a 5 digit ID for your file (domain.com/aCd5y)

Should any letters/digits not be used in the final ID, to make it easier for people to read and share links (without copy and paste)?

Should I avoid i, I, l or 1? How about O or 0? In the URL bar in Chrome, 0 doesn't have a line through it, and I (uppercase i) and l (lowercase L) look different, but I'm not sure about other browsers, devices, screens, etc.. for example in this post, uppercase I and lowercase L look the same.

7
  • 14
    There are no letters/numbers that have been known to cause death when included together, so use any combination you wish. If you want to make to limit confusion, avoid the letters/numbers you list above for the reasons you list. Commented Mar 3, 2014 at 19:37
  • 2
    How are you proposing to make it easier for users to read and share links, easier than using copy and paste? Do they need to retype the ID themselves? Commented Mar 4, 2014 at 11:59
  • 2
  • 2
    Is there a reason the string needs to be 5 characters long? You could eliminate the uppercase letters and numbers entirely, increase the string to seven characters and have about nine times as many unique combinations.(62^5 = 916 Million Combinations, while 26^7 = 8 Billion Combinations) Commented Mar 4, 2014 at 17:35
  • 3
    Look into Gfycat -> gfycat.com The way it creates new URLs through a combination of nouns, verbs, and adjectives to make it easy to remember URLs as opposed to tinyurl.com/ir62z9fegcxz Commented Mar 4, 2014 at 20:27

6 Answers 6

61

What you are referring to are called Ambiguous characters since they seem similar to certain numbers.

You can get the list of those characters from this C code file on Pwgen.

If you are not comfortable reading C code, the characters and the corresponding confusing numerals (and letters) are

B = 8
G = 6
I = 1 = l (lowercase L)
O = 0
Q = D
S = 5 
Z = 2

All of this said, I strongly recommend choosing a font which will enhance the legibility of your text as that would help ensure the confusion is relatively lesser. The factors to choose the correct font would involve

  1. Fixed width: For picking out random numbers/letters, fixed width helps tremendously, since the kerning isn't changing as you move across the font.

  2. Use a font with separate 0/O looks - those definitely mess people up. Look for other letter/number combinations that are similar. Potentially, leave 0/O out of the mix just for this reason.

  3. Choose a font with subtle serifs and weight changes.

Here is an article worth checking out about font legiblity

I also recommend reading this interesting article on the UX coupon codes which has a couple of inputs on how to remove ambiguity. To quote the article

Solution 1: Deal with ambiguity If you are worried about the distinction between O0, 1Il, 8B, or any other combinations, treat them as the same character!

This is what Base32 does. It will standardize on one of the characters above (say the digits 018), and omit the ones are too similar (in this case OIlB).

When you receive input from the user, map the omitted characters to the canonical ones (e.g. replace the letter O with the digit zero). This way, even if the user can't figure it out, it doesn't matter anyways.

Solution 2: Remove all ambiguity Base32 still leaves characters which seem like they may be ambiguous, even if underneath they can't be. For users with a little experience with this, they will still stop to question what they are doing.

Ergo, you can take it a step further and completely remove all characters that could be perceived as ambiguous (e.g. all of 0O1Il8B).

After all, you don't actually need your alphabet size to be a power of two. It is easy enough to convert into arbitrary bases, and you don't need it to be particularly fast either (since this is often coinciding with user input).

4
  • 6
    OP wants "to make it easier for people to read and share links", which probably implies that the initial font is less relevant than the actual characters in the ID. Commented Mar 3, 2014 at 20:31
  • pwgen also has an option to turn off including vowels, so that they won't create offensive strings like in S Vilcans answer. Commented Mar 4, 2014 at 18:40
  • haha.. The most hated ones for me are l(lower case L) I(capital i) 1(numeric one) and classic 0(zero) and O(capital O)
    – exexzian
    Commented May 15, 2015 at 19:49
  • How does Q = D? Q looks more like O to me.
    – clickbait
    Commented Aug 12, 2018 at 20:02
8

If your goal is to make it easy for humans to read the ID you shouldn't use any characters that may be mistook for anything else.

My first recommendation would be to only use uppercase letters and numbers, leaving out O and 0. What is left would be easier to copy due to the consistency.

If that isn't possible, I would then recommend leaving out: 0, O, o, i, I, l, and 1.

However, if for some reason you can be sure that your users will only see the font in a monospace font (usually used in programming), you may not have to have this step, as characters are usually easily distinguishable in monospaced fonts.

1
  • 2
    Those are the big ones (ones/els and zeros/ohs). Eliminating those can eliminate a majority of the problems, IMHO.
    – DA01
    Commented Mar 3, 2014 at 20:52
6

Use uppercase letters and digits only, omitting I, O, 1 and 0. That should be unambiguous enough.

This same issue comes up with car licence plates. In New Zealand, custom plates have up to six characters, which can be any uppercase letter or digit. Foolishly, they allow both O and 0 as well as I and 1. As a result it is often hard to read a licence plate quickly (e.g. B1GB0Y), which seems to defeat the purpose.

I think they should have avoided this by using a single glyph for O and 0, and another single glyph for I and 1.

3
  • 1
    British plates deliberately have the same symbols for 1/I and 0/O. And they don't use Q and have been careful in the past about Z. However, it's now possible to have YS05YKH and Y505YKH on the road. Commented Mar 4, 2014 at 7:26
  • @AndrewLeach: I don't think you can have Y505YKH in GB now, as the format follows a strict pattern - two Alpha characters, two Numeric, three Alpha. However I am not sure about custom plates though, although I believe the rules are that you can't create a custom plate using similar format to the standard format.
    – JonW
    Commented Mar 4, 2014 at 11:05
  • 2
    Yes, you can. Numbers starting Y5 were previously validly issued in 2001 by DVLA, and the YS prefix is also in use now. Commented Mar 4, 2014 at 11:23
4

There are indeed a series of characters that usually cause readability issues in some circumstances, depending on typeface used, for instance, or even in captchas because these are being distorted. This includes : - Letters vs digits: hard to tell distorted O from 0, 6 from G and b, 5 from S/s, 2 from Z/z, 1 from l - Digits vs digits: consider 5 with 6, 7 written differently in some countries or confused with 1, … - Letters vs letters: “vv” vs “w”, “cl” vs “d”, “nn” vs “m”, “m” vs “rn” vs “nn”, … - Characters vs clutters: random arcs sometimes introduced as clutters and perceived as confusing as opposed to characters (J vs L vs 7 for instance)

3

Very interesting question. If it is intended to be used without copy-paste it may be an idea to avoid letters/numbers that look alike. Either you remove them or you use a font where they look different (perhaps something like FE-Schrift used on German car registration plates). enter image description here Another issue is that of avoiding combinations that may be embarrassing or offensive. a550rgy is a famous example. Numbers that 666 or 69 my be a problem. Letter combinations like SS, SA, NS and so on may also be a problem.

It all boils down to how much work you are willing to put in and how important it is.

2
  • 1
    Adding: HH, 88 for the right wing extremist stuff.
    – kaiser
    Commented Mar 4, 2014 at 20:34
  • 2
    Trying to filter anything anyone could find offensive would be an excercise in futility. So I wouldn't even attempt it.
    – Philipp
    Commented Mar 5, 2014 at 15:17
0

Depending on your audience it might be safest to avoid using vowels in your ID if users are meant to see this ID. So many bad words are easily removed from accidentaly being part of the ID by removing vowels.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.