Two-factor authentication (2FA) is an extra layer of security used to ensure that people trying to access an online account are who they say they are. To begin with, a user will enter their username and password as a first factor. Then, instead of immediately gaining access, they will be required to provide an authentication code generated by the physical device they are using as a second factor. With 2FA, a potential compromise of only one of these steps will not unlock the account, so your account is more secure.