Make a mistake in your user account name?
Instructions apply to OS X Yosemite (10.10.5) and later.
you’ve got the option to’t rename an account you’re logged in to.

access to a different account with admin permissions orcreate a spare administrator account.
After setting up the second administrator account, complete the following steps.
From the Apple menu, selectLog OutUserName(whereUserNameis the name of the account you want to change).

From the login screen, sign in to a different or new administrator account.
The Users folder contains your current home folder, which has the same name as your account name.
Write down the name of your current home folder to reference later.

opt for home folder to rename and pressEnterto edit it.
Write down the name of the new home folder to reference when renaming your account.
From theApplemenu, selectSystem Preferences>Users & Groups.

InUsers & Groups, opt for lock icon and bang out the password for your spare administrator account.
In the list of users,Control+clickthe user account name you want to change and selectAdvanced Options.
In theAccount namefield, bang out the name of the new home folder you created and selectOK.

Close all open windows and dialog boxes and power cycle your Mac.
Sign out of the renamed account, sign in to the spare administrator account, then repeat this procedure.
You may need to kickstart your Mac again.
Account management is now easy, and you’ll feel like a pro.