In computer science, you should have a username or a user name or a user-name and a password to be able to log into the system.
Which one is the correct spelling?
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It only takes a minute to sign up.Sign up to join this community
The correct spelling in this case is username.
The username is the (usually unique) thing you type in with your password, for example: bobsmith66.
The user name is the name of the user, the user's real life name, for example: Bob Smith. User name is sometimes used for username, but occasionally it makes a difference, so be clear and avoid the ambiguity. (Better still, use full name when you want them to enter Bob Smith.)
User-name is a variant of username, but this is rarely used if ever.
Obligatory Google Ngram:
In case the link breaks again: username is much more common these days; user-name is not used at all.
Like most things in language, it depends upon context.
If you are writing a journal for a computer science publication, username is acceptable.
If you are writing the user's manual or labeling a field, I would use "user name" since the users may or may not be well versed in computer science, and it just feels less complex.
The O.E.D. often defines words merely because they're commonly used, regardless of their correctness. (For example, I don't consider "LOL" or "ginormous" to be words.)
I realize that it is often used to describe "the thing you type in with your password," but that is more correctly called the user ID since it is not the actual name of the user.
In my opinion, it's a compound noun and the correct spelling is "user name" as in "the name of the user." Just because we can delete the space between two words doesn't mean we should, although plenty of compound nouns do. Language evolves, of course, and it's just as likely that we're in the middle of this word's evolution. In a few years, I may change my mind and edit this entry.