Should usernames be unique? It would get rid of annoying id numbers and reduce impersonation. After all, why would anybody want others to have the same name as them? On the other hand, a new user might not be able to sign up with their real name. In real life you can have any name you want.

So which is better?

  • 4
    @JonathanHobbs I do!
    – kBisla
    May 12, 2014 at 1:57
  • 2
    Look at the SE sites. They seem to be working well without unique usernames.
    – PlasmaHH
    May 12, 2014 at 8:43
  • 3
    @PlasmaHH: +1 yes, but to all intents and purposes these are not user names, but "display" names (nitpicking I know, but still, it only works because I can distinguish to users with the same display name possibly by their avatar, but certainly by their ID number). May 12, 2014 at 12:00
  • 1
    @MarjanVenema: Your nitpicking seems to imply that when a user name is not a display name, it must be a unique id, and that when it is not unique, its just a display name since there is always a way to distinguish by some unique key (and there always needs to be a unique key)
    – PlasmaHH
    May 12, 2014 at 12:15
  • 2
    @MarjanVenema: So if your definition implies that usernames are the unique id, then the question of them being or being not unique seems to make no sense, no?
    – PlasmaHH
    May 12, 2014 at 12:18

4 Answers 4


It really all depends on your approach. These days it is easier to ask people to log in by email, which can be used as a user name and should be unique. It is sometimes hard to remember the username you have for some sites as they may differ from other sites you visit. By doing email you are ensuring it would be unique.

One thing to keep in mind though is that you should definitely make an ID for each user. From there you assign an email or even a username. This would allow the user to change it at any time even if you don't intend to allow them to do this. Otherwise you may pin yourself in a corner and would have a hard time improving your approach.

Another thing you can also do is implement a dual email and username login approach. An example is Facebook. You can login to facebook with your username, your email or even your phone number. Username should definitely be unique in nearly all cases. However you can add a field if you wish for display name, which won't have to be unique. Yes it is slightly more complicated to build, but in the end you are reducing friction for your users and making it far easier for them to come back.

  • An email? I didn't think of that.
    – bjb568
    May 12, 2014 at 2:11
  • 5
    Please do note that you might still want to enforce a unique username for your users depending on how much interaction there is between them. If you are running a forum, a chat group or another user interaction heavy service, knowing that a specific username will always refer to the same person helps with moderation and reputation. Also, a number of people would never want to use personally identifyable information as their username, like their email address. For Example: a few years ago, the World of Warcraft forums were in an uproar because Blizzard wanted to force people to use real names.
    – Nzall
    May 12, 2014 at 8:51
  • 3
    Contrary to your assumption, I use the same username on all sites I sign up to, but give them different email addresses to spam me. Therefore I am far more likely to remember my username (and with Lastpass this is almost guaranteed) but I may forget the email address that I gave them.
    – dotancohen
    May 12, 2014 at 12:26
  • 2
    I found out the hard way that an email address is not as great an idea as you may think... Sure one email belongs to one user... But one user can have many emails :P
    – major-mann
    May 12, 2014 at 12:58
  • 1
    Users may have multiple emails, but generally speaking users have a primary one. You can always allow the user to attach as many emails as they want to their account. But this is more of an implementation problem than a UX one. May 12, 2014 at 14:20

Forcing unique usernames is a necessary side effect of the way things work. You have to give everyone a unique something to distinguish them. But it's not necessary that this unique thing be their name! A unique e-mail would do, a unique internally generated id would do. In school days, a roll number/student id did the job.

Facebook doesn't force unique names for users, they generate IDs for everyone. Twitter has to force a unique handle but you name can be your real name! Totally depends on your application!

  • 1
    I know I have to have a "unique something", I'm wondering what the user will like that something to be.
    – bjb568
    May 12, 2014 at 2:09
  • depends on how much they're gonna use that something. fb ids are never used by user but twitter handles are. What are you working on?
    – kBisla
    May 12, 2014 at 2:13
  • 1
    Well, everything will be username-based. I'm not going to publicly hand out emails (in the place of usernames).
    – bjb568
    May 12, 2014 at 2:17
  • Then use something like twitter handles and embrace the necessary side effect.
    – kBisla
    May 12, 2014 at 2:23
  • So your answer is yes. Should login be by still be by email if usernames are unique?
    – bjb568
    May 12, 2014 at 2:25

I think whatever the token is that you use for logging the user in, it should be unique.

I think the real question is, should they login with a username or an email address? My thought is they should always login with an email address for a few reasons:

  • Most people are more likely to remember their email address. Personally I have 3 email addresses (2 businesses, 1 personal) but I have half a dozen usernames
  • If you are running a social website where the username represents an online identity that others can see (forums, chatrooms, etc - which I personally think is one of the only situations where a username should be used), you are now advertising half of your login to the world. Regardless of if your site needs a username, I believe you should use the email address. Of course, these aren't always secured, and that's why a good password is important.
    • In this case the username probably doesn't need to be unique, unless you have another reason for it, like a personalized URL or something (website.com/u/your_username)
  • The email address is automatically going to be unique(ish) to the user. There are situations where couples share an email, but if they want to maintain a shared identity, then that's their choice.

tl;dr; use email addresses as the login token. I recommend only allowing users to create a username if that username needs to be used to represent the users identity somehow - but even then, login with the email address.


The term "username" is used for a couple of different things:

  • Authentication login name: To login, a user has to say who they are and give a secret (password). So here the purpose is identification and it MUST be globally unique (on the whole service). A common unique identifier that people are willing to share is their e-mail adress.
  • Mentioning: "@bjb568 what do you think?" - here, in many contexts, I would expect that you get a notification of me mentioning you. This must be unique in this context - no need for global uniqueness.
  • Human recognizable display name: When we see the users icon and name, we as humans have an idea who we are talking with. Although bjb568 and ck1x972 have nothing in common, they are both super hard for humans to recongize. So uniqueness might be important here, but in another sense than in the string equality one.

Additionally, I would not want to force a user who wants to take a clear name to use a different one because his name is already taken.

What do others do?

  • StackExchange: Display Name and email for authentication; display name is NOT unique

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.