Tired of scrambling for text message codes every time you log in to an app or website? Want to use two-factor authentication — without codes through text message, calls or just a separate “authenticator” app? Find out here how to set up and use Safari as a two-factor authenticator app on a Mac ⤓.
On This Page
How to Set Up Safari for Mac as a Two-Factor Authenticator App
Time needed: 3 minutes
To add a new web site account for generating two-factor authentication codes right in Safari for macOS on a Mac:
- Click on the QR code for setting up a two-factor authenticator (2FA) app with the right mouse button in Safari.
No QR code: If you have no QR graphic but an alphanumeric code, see below.
- Select Set Up Verification Code from the connects menu that has appeared.
- Unlock passwords with your iCloud or macOS authentication
- Highlight the account for wich you want to add the 2FA authenticator code.
- Click Add Verification Code.
All safe and factored?
Tips help fuel these email and tech how-tos.
Set up Safari as a 2FA Authenticator App without a QR Code
To set up 2-factor authentication in Safari using an alphanumeric code:
- Open System Settings (or System Preferences) on the Mac.
Here’s how: Choose (Apple logo) in the menu bar, for instance, and select System Settings… from the menu that appears. - Go to the Passwords category.
Alternative: You can also open the Passwords tab in Safari settings; they access the same set of passwords and 2FA authentication data. - Log in to the Mac account with your password, fingerprint, or other means of authentication.
- Highlight the web site account for which you want to add two-factor authentication data.
New account: You can also click + to add a new account, of course. - Click Edit….
- Now select Enter Setup Key… under Verification Code:.
- Type or paste the code for setting up two-factor authentication from the web site or app.
- Click OK.
On an iPhone? How to Use Safari as an Authenticator App on iPhone
Enter a Verification Code using Safari as a Two-Factor Authenticator App
To authenticate on a website using Safari’s built-in 2FA authenticator app:
- Click in the field to enter the authentication code.
- Select the desired account from auto-complete data.
Authorize: Authenticate with your Mac using password, fingerprint or another factor if prompted. - Press Enter if needed.
Done automatically: Usually, Safari will submit the authentication code automatically without you pressing Enter.
It holds any code and password: How to Save Any Password Safely on a Mac
How to Use Safari as a Two-Factor Authenticator App for Mac: FAQ
Can I copy the verification code for use in a different browser?
Yes.
To use the code generated by the Safari two-factor authentication app in another browser:
- Open Passwords in System Settings (see above).
- Search for an open the desired account.
- Click on the code under Verification Code.
- Select Copy Verification Code from the context menu that has appeared.
Does verification work offline?
Yes.
Codes are generated using information on the device. Once set up in Safari, code generation works offline.
Can I reset or renew the authentication info for an account?
Yes.
Each account always can have exactly one key shared between the site and Safari for authenticating access.
To add a new key, first delete the old one:
- Open Passwords in System Settings. (See above.)
- Highlight the account for which you want to add new 2FA information.
Search: Click in the Search field, of course, and type the domain or username. - Click Edit….
- Now click Delete Verification Code.
- Click Delete Verification Code again.
- Now click Save.
How does code generation for 2FA work?
When you set up code generation in Safari for two-factor authentication, you enter a secret value from the web site into Safari.
Using
- that secret value (known now to both the site and your Safari, but nobody else),
- a value derived from the current time (also shared) and
- a common algorithm,
both the website and Safari compute a code, which they then compare.
Where does Safari store 2FA codes?
Safari uses the Passwords app to store two-factor authentication information. The data is encrypted on device and synchronized using iCloud between devices.
(Tested with Safari 15–18 and 26; first published October 2021, last updated June 2026)