Find Your Username in Windows 11 and 10 (5 Ways)

Logeshwaran

To find your Windows username, press Windows key + R, type cmd, press Enter, then type whoami and press Enter. You get COMPUTERNAME\username — the part after the backslash is your username. Same on Windows 11 and Windows 10, no administrator rights needed. But there is a good chance the real problem is different: your Microsoft account email is not your Windows username. Windows keeps five separate names for you, and whatever just rejected what you typed is asking for one specific one. The table below says which.

⚡ Quick Answer

Just the namewhoami in a command prompt.

Name only, no computer nameecho %USERNAME%

Every account on the PCnet user, or Get-LocalUser in PowerShell.

The SID, for registry work → whoami /user

No command line → Settings → Accounts → Your info.

Something rejected what you typed? Find out which of your five names it wanted.

Three wrong guesses and a locked account

Jake was setting up a shared folder so the shop's second computer could reach the stock spreadsheet on the first. Windows asked for a username and password, and he typed the email address the machine signs in with, because that is what it says on the sign-in screen.

Rejected. He tried it again more carefully, in case of a typo. Rejected. He tried it with the password he was certain about. Rejected, and then a message telling him the account had been locked for a while after too many attempts.

"It's the right email," he said. "It's on the screen in front of me. It's how I sign in every morning."

"It is how you sign in. It's not your username. Windows made you a short name underneath the email when it set the machine up, and the sharing box wants that one."

"So I've got two names?"

"You've got about five. Most of the time it doesn't matter which is which. Today it does."

That is really what this search is about. Almost nobody wants to know their username for its own sake — they want to know it because a box refused what they typed, and the box did not explain what it wanted instead.

The five names Windows has for you

Find the situation you are in on the left, and use the name in the middle.

The name What it looks like Who asks for it
Account name
the actual username
Short, no spaces — jonat Network shares, permissions boxes, Run as different user, most software. This is the answer to the question.
Microsoft account email jonathan@example.com The sign-in screen, Microsoft services, Remote Desktop to a machine using a Microsoft account.
Display name Spaces and capitals — Jonathan Smith Nothing technical. It exists to be shown on the Start menu and the sign-in screen.
Profile folder name C:\Users\jonat File paths, scripts, backup tools. Usually matches the account name, but not always.
SID S-1-5-21-... The registry, and permissions internally. You need it only when a guide asks for it by name.

The one-line version: if something is asking for a username and it is not the Windows sign-in screen, it almost certainly wants the short account name. If you have typed an email address and been refused, that is why.

The commands, and what each one is good for

All of these work in Command Prompt or PowerShell unless noted, and none of them need administrator rights. To open one: Windows key + R, type cmd, press Enter. If you have never used it, our guide to opening Command Prompt, including as administrator covers the ground.

1. whoami — the one to remember

whoami
desktop-tg2ggrb\blackbeast

Two pieces of information in one line. Before the backslash is where the account lives — your computer's name on a home machine, or your company's domain name on a work one. After it is the username.

That first half matters more than people expect: it is how you tell a local account from a domain account without asking anybody. And most things that want a username in a network context want the whole thing, backslash included.

One harmless oddity: whoami prints everything in lower case even if your account name has capitals in it. Windows does not care about capitalization in account names, so nothing is wrong and nothing needs fixing.

2. The username on its own

echo %USERNAME%    # Command Prompt
$env:USERNAME      # PowerShell

No computer name, just the account name — and with its original capitalization, which is the small difference from whoami. Useful when you are pasting the name into something and the extra prefix would break it.

3. net user — every account on the machine

net user

Lists every account, including built-in ones such as Administrator and Guest that are normally disabled and that you should leave alone. Add a name after it — net user jonat — and you get detail for that one account: when the password was last set, when it expires, which groups it belongs to.

This is the command to run on a second-hand machine or one you have inherited, to see who else has an account on it.

4. Get-LocalUser — the tidy modern version

Get-LocalUser

PowerShell only. Same information as net user in a proper table, with a column showing which accounts are actually enabled — which net user makes you work out for yourself. If PowerShell is unfamiliar, our beginner's guide to PowerShell commands is the place to start.

5. whoami /user — when you need the SID

whoami /user

Prints your username alongside a long identifier starting S-1-5-21. That is the security identifier, and it is what Windows genuinely uses internally — names are a convenience layer for humans on top of it.

You need it when a guide tells you to find the registry key named after your account, which happens with profile problems and a handful of per-user settings. Our post on opening Registry Editor covers the safety rules before you go looking.

And the command half the internet still recommends, which is gone

A great many guides for this question — including ones published recently — tell you to run wmic useraccount get name.

On a current Windows 11 machine that command no longer exists. We checked on the machine this post was written on, running 24H2, and it is simply not there: you get a message saying the command is not recognized, which looks alarming and means nothing except that the tool was retired.

It was deprecated some years ago and has since been removed from new installations. If a guide tells you to use it and your machine says it does not exist, the guide is out of date rather than your Windows being broken. Get-LocalUser is the replacement.

🔬 How this was tested

Every command on this page was run on 9 August 2026 on Windows 11 Enterprise, version 24H2, build 26100, and the outputs quoted are the real ones from that machine rather than illustrations. whoami returned desktop-tg2ggrb\blackbeast; $env:USERNAME returned the same name with its capitals intact, which is where the note about lower case comes from.

The wmic finding is the reason we ran them rather than trusting memory: on that machine the command is absent, so the advice printed on a large share of the pages competing for this query now fails on a current install. If your machine still has it, you are on an older build or an upgraded rather than clean installation — either is fine, and Get-LocalUser works on both.

Without touching the command line

Settings → Accounts → Your info. This shows your display name and, underneath it, either your email address or the words "Local Account". That tells you which kind of account you have, which is half the battle — but note that it shows the display name, not the short account name.

Open File Explorer and go to C:\Users. The folder names there are the profile folders, one per account that has signed in. On most machines the folder name and the account name match, which makes this a decent shortcut.

The sign-in screen. Lock the machine with Windows key + L and look at the bottom-left corner, where every account on the PC is listed. Useful when you are trying to remember what accounts exist rather than what yours is called.

Press Ctrl + Alt + Delete. The screen that appears names the account you are currently signed in as, in the form your organization would recognize. It is the fastest route on a work machine.

Why C:\Users has a folder with a strange short name

Somebody sets up a new laptop, signs in with jonathan@example.com, and later finds their documents living in C:\Users\jonat. It looks like a mistake or a truncation error. It is neither.

When Windows creates a profile for a Microsoft account, it has to invent a short folder name, because a full email address makes a poor folder name — it contains an at sign and dots, and it can be very long. So it takes the first few characters of the email and uses those. Two people named Jonathan on the same PC would get jonat and jonat000 or similar.

Do not rename that folder. It is the single most tempting bad idea in this whole area. Enormous numbers of settings, installed programs, shortcuts and registry entries record the full path by name, and renaming the folder leaves every one of them pointing at somewhere that no longer exists. The result is a profile that half works, which is far worse than a folder with an ugly name.

If the name genuinely has to change, the supported route is to create a new account with the name you want and move your files across. We cover the whole thing, including the cases where people have already renamed it and need to get back, in our post on an incorrect user name in the C:\Users folder.

And if this is one of several small things going wrong in the same account, the profile itself may be the problem rather than the name — the User Profile Service failing to sign you in is the next place to look.

What to type when each thing asks

A network share on another PC

Use COMPUTERNAME\username for the machine you are connecting to, not the one you are sitting at. Jake's mistake in reverse: the credentials have to exist on the far end. If that machine's owner set it up with a Microsoft account, their short account name is what you want, and they can find it with whoami in ten seconds.

A permissions dialog

Type the short account name and click Check Names. Windows will either complete it or tell you it cannot find it, which is a far quicker test than guessing. This is also where you occasionally need built-in names such as Everyone or SYSTEM, which are not accounts belonging to people at all.

Remote Desktop

The name as it exists on the remote machine. If that machine signs in with a Microsoft account, you may need the full email address there rather than the short name — this is the one place where the email is often correct, which is exactly why the rule is confusing. If a connection is refused with credentials you are sure about, try the other form before assuming the password is wrong.

Software licensing, and support

Almost always the short account name, or the display name if they say "name on the account". If in doubt, give both and let them pick — a username is not a secret, and it saves an email round trip.

🙋‍♂️ Jake's Reality Check

"Someone rang the shop last week asking for the username on a customer's machine. Said they were from support. Should I have given it?"

No — not because a username is dangerous, but because of who was asking. A username on its own is roughly as sensitive as an email address: fine to hand to support you contacted, and useful to them. The problem is the direction of the call. Nobody legitimate phones you first and asks for account details, and the ones who do are collecting the small pieces that make the next call sound convincing. The rule that has never let anybody down: if they called you, you call them back on a number you looked up yourself. And a username should never travel in the same conversation as a password, a code from a text message, or a request to install remote access software.

Finding the username on a PC you cannot sign into

This comes up with an old machine of your own, or one that has been sitting in a cupboard since somebody set it up for you.

The sign-in screen lists the accounts. Bottom-left corner, every account that can sign in. Often that is all you needed — you recognize the name the moment you see it.

If another administrator account works, sign into that one and look in C:\Users, or run net user for the full list.

Safe Mode sometimes exposes the built-in administrator account on older setups, which is enough to read the account list.

To be plain about the limit: none of this gets you past a password you do not have, and this page is not going to help with that. Finding out what an account is called and getting into it are different problems. If the machine is yours and the password is genuinely lost, the honest routes are the Microsoft account recovery process for a Microsoft account, or a reinstall for a local one — and a reinstall means losing whatever is on it.

If you are creating a username: the rules nobody tells you

The other half of this question is people who are not looking for a username but trying to make one, and being refused without being told why. Windows is fussy here and its error messages are unhelpful.

  • Twenty characters maximum for a local account name. Longer is simply rejected.
  • It cannot be the same as the computer's name, or as any other account or group on the machine. This catches people who name the PC after themselves and then try to create an account with the same name.
  • These characters are not allowed: " / \ [ ] : ; | = , + * ? < > @. The at sign is the one that surprises everybody, because it makes an email address an invalid local account name by definition.
  • It cannot be only dots or only spaces, and trailing spaces are stripped, which produces the confusing case where two names look different and Windows says one already exists.
  • Spaces in the middle are permitted and are a bad idea anyway. Every path containing that account then needs quoting, and a share of scripts and older programs will get it wrong.

A short, lower-case, single-word name with no punctuation avoids every one of these, and it is what we would pick on any machine we expected to still be using in five years.

Using your username in a path without typing it

The practical reason to know about %USERNAME% is that you can put it in a path instead of your actual name, and Windows fills it in. That makes an instruction work on anybody's machine, which is exactly what you want when writing something down for somebody else, or for yourself on a future PC.

C:\Users\%USERNAME%\Downloads
%USERPROFILE%\Downloads    # shorter, and safer

Paste either into the File Explorer address bar and it goes to your Downloads folder. %USERPROFILE% is the better of the two: it holds the real path to your profile folder, so it is still correct on the machines where the folder name and the account name differ — which, as we saw above, is most machines set up with a Microsoft account.

These work in the Run box, in File Explorer, in Command Prompt and inside shortcuts. In PowerShell the equivalents are $env:USERNAME and $env:USERPROFILE.

Worth knowing when somebody sends you a path with their own name baked into it and it does not exist on your machine. Swap the name for the variable and it works for everyone.

Questions people actually ask about this

How do I find my username in Windows 11?

Press Windows key plus R, type cmd and press Enter, then type whoami and press Enter. It prints your computer name, a backslash, and your username. The part after the backslash is the answer. This works the same on Windows 11 and Windows 10, needs no administrator rights, and takes about five seconds.

Is my email address my Windows username?

No, and this is the reason most people end up searching for this. If you sign in with a Microsoft account, your email is how you authenticate, but Windows still created a separate short account name for you underneath it. Anything that asks for a Windows username, such as a network share or a permissions box, usually wants that short name and will reject the email. Run whoami to see it.

Why does the folder in C drive Users not match my name?

Because when you set up Windows with a Microsoft account, it builds your profile folder from the first few characters of your email address rather than your name. Somebody signing in as jonathan at example dot com typically ends up with a folder called jonat. It is not a mistake and it does not affect anything except appearances. Renaming that folder by hand breaks things badly, so it is not the fix it looks like.

What does whoami actually show?

It prints the computer name and your username separated by a backslash, in that order. On a machine joined to a company domain the first part is the domain name instead. Everything before the backslash tells you where the account lives, and everything after it is the account name itself. It also prints everything in lower case, which is only cosmetic.

How do I see all user accounts on this PC?

Open a command prompt and run net user with no arguments, which lists every account on the machine including the built-in ones that are normally disabled. In PowerShell, Get-LocalUser gives the same information in a tidier table with a column showing which accounts are enabled. Either one is the quick way to check whether an old account is still present on a machine you have taken over.

Why does wmic useraccount get name not work anymore?

Because that tool has been deprecated and is no longer present on current Windows 11 installations. On a machine running a recent build, typing it returns a message saying the command is not recognized, which reads like something is broken when nothing is. A great many older guides still recommend it. Use Get-LocalUser in PowerShell instead, which does the same job and is the supported replacement.

What is a SID and when do I need it?

A SID is the security identifier, a long string beginning with S-1-5 that is the identity Windows actually uses internally. Names are for people; this is what permissions and the registry are really keyed on. You need it rarely, mostly when following a guide that involves registry keys named after accounts, or when a profile has gone wrong. Run whoami with the user option to print yours.

Which username should I type for a network share?

The short account name from whoami, and usually with the computer name in front of it in the form computername backslash username. For a work domain it is the domain name instead of the computer name. If the share is on somebody else's PC, it is that machine's name and an account that exists on that machine, not yours. Typing an email address here is the most common reason the box keeps reappearing.

How do I change my Windows username?

For a local account you can rename it in the user accounts management console, and for a Microsoft account you change the display name on the account website. What neither of those changes is the profile folder in the Users directory, which keeps its original name forever. That is normal. Renaming that folder to match is a genuinely bad idea because a great many settings point at the old path by name.

Can I find the username without signing in?

Usually yes. The sign-in screen itself lists the accounts on the machine in the bottom corner, which is often all you needed. If you can get in with a different administrator account, the folder names in the Users directory show who else has profiles on the PC. Neither of those gets you past a password you do not have, and nothing on this page is intended to.

What is the difference between the display name and the username?

The display name is the friendly name shown on the sign-in screen and the Start menu, and it can contain spaces and capitals. The username is the short account name Windows uses for permissions and paths, and it is what commands report. Changing the display name does not change the username. Programs asking you to identify yourself almost always want the short one.

Does the username matter for Remote Desktop?

Yes, and it is a frequent stumbling block. You need the username as it exists on the machine you are connecting to, not the one you are sitting at, and if that machine signs in with a Microsoft account you may need the email address there rather than the short name. When a connection is refused with correct-looking credentials, the name format is the first thing to check.

Why do whoami and the environment variable show different capitalization?

Because whoami prints everything in lower case as a matter of style, while the environment variable keeps the capitalization the account was created with. Neither is wrong and there is nothing to fix. Windows account names are not case-sensitive, so typing it either way works everywhere it is asked for.

How do I find my computer name as well?

You already have it if you ran whoami, because it is the part before the backslash. You can also see it in Settings under System and then About, or by running hostname in a command prompt. Most things that ask for a username in a network context want the pair together, so it is worth noting both down at the same time.

Is it safe to share my username with support?

A username on its own is low risk, and support staff often genuinely need it. Treat it the way you would your email address rather than your password: fine to give to a person you contacted yourself, not something to type into a page that phoned you first. Never pair it with a password, a recovery code or a remote access session for somebody who called you out of the blue.

How Jake's share ended up working

He ran whoami on the machine holding the spreadsheet, got a five-letter name he had never seen before, typed that instead of the email, and it connected first time. Total elapsed time from the phone call: about a minute.

"A minute. Against forty minutes of typing the same email in and getting angrier."

"You weren't wrong about the email, that is genuinely how you sign in. You were answering a different question from the one the box was asking."

Which is worth keeping. If a credentials box keeps refusing something you are certain is correct, the odds are good that it is not wrong — it is the wrong kind of name. whoami settles it in five seconds, and it is the one command from this page worth committing to memory.

Revision note. Originally published 16 January 2017 and rewritten on 9 August 2026. The original answered the question people were asking then, on machines where almost everyone had a local account and your username was simply your username. What has happened since is the Microsoft account: sign in with an email, and Windows quietly creates a short account name underneath it that you never see until something asks for it and rejects what you typed. That split is what generates this search today, so this version leads with it and gives you a table of which of your five names each situation wants. Also updated: the commands were run on a current Windows 11 machine, which is how we found that wmic — still recommended on a great many pages, some of them recent — is no longer present at all. If a box on your screen is refusing a name and it is not covered here, write in through the contact page and tell us what the box said; the list of which thing wants which name is exactly the sort of thing that gets better with reader reports.

Related