How to Use Safari's Built-in 2FA Code Generator - MacRumors
Skip to Content

How to Use Safari's Built-in 2FA Code Generator

by

With online account hacking becoming increasingly widespread, Mac users should make sure they're taking every security measure available to them. In other words, consider using Apple verification codes to protect your accounts. Keep reading to learn how it works.

iPhone 13 Security
One of the best ways to protect any online account is by using two-factor authentication (2FA). 2FA offers hardened security during login attempts by requesting that the user provides an extra piece of information only they would know, such as a randomly generated code from a third-party.

In macOS Monterey and later versions of its Mac operating system software, Apple's Safari browser (version 15 and later) includes a built-in two-factor authenticator that can generate verification codes for additional sign-in security. This means if a site offers 2FA, you can set up verification codes for it without downloading a third-party app.

Verification codes are backed up via iCloud, and once set up, the codes will autofill when you sign into the site using any Apple device linked to your Apple ID. This makes using 2FA on iPhone and iPad much more streamlined.

Enabling 2FA on the Account or Service

First, make sure you have the latest version of Safari (Safari 17). Once you've done that, you'll need to enable the use of a 2FA app on whichever website or service you are trying to secure. Note that if you've already enrolled an account with 2FA on a mobile app, you'll either have to unenroll from 2FA or use the current 2FA code from your mobile app.

twitter 2fa
You may need to explore the security or privacy settings of the site to enable the use of an authenticator app. On X (formerly Twitter) accounts, for example, the 2FA option is found under Settings and privacy -> security and account access -> Security.

Using Setup Keys

Once you've enabled 2FA on the account or service in question, you'll be asked to either enter a setup key on your device or scan a QR code using your device's camera. Note that you'll need to ensure that Safari's AutoFill feature is enabled (Safari ➝ Settings ➝ AutoFill) and the website's login credentials are saved in Safari for the 2FA code generator to work properly.

  1. Open Safari, then select Safari ➝ Settings... from the menu bar.
  2. Choose the Passwords tab, then either type your user password or use Touch ID to authenticate.
  3. Find and open the entry for the site you want to add 2FA to, then click Set Up next to "Verification Code," under Account Options.
  4. If the site offers a setup key, enter it in the Setup Key field. If it offers a QR code, Control-click it and choose "Set Up Verification Code". (Alternatively, you can download the QR code image and choose it using the option.)

safari verification codes

Using Safari's Generated 2FA Code

  1. Open Safari and navigate to the website that requires two-factor authentication (2FA).
  2. Enter your username and password for the website as usual.
  3. When the site asks for a 2FA code, look for Safari's built-in suggestion that appears above the input field.
  4. Click on the 2FA code suggestion. Safari will automatically generate and fill in a 2FA code.
  5. Complete the login process by verifying the 2FA code, and you're done.

In future, when you come to log in to the site or service and you're prompted for a verification code, Safari will automatically display the latest code as an AutoFill option – all you need to do is click the code to enter it into the input field, and away you go.

Popular Stories

Switch to Safari

Apple Explains Why Chrome Users Should 'Switch to Safari'

Tuesday October 13, 2026 5:29 am PDT by
Apple has launched a new "Switch to Safari" marketing campaign that encourages Chrome users to switch to Safari as their web browser of choice on the Mac. "Safari is a more powerful and private browser than Chrome," says Apple. Apple has a new "Switch to Safari" page on its website that outlines more than 10 reasons that Chrome users should switch to Safari, including faster performance...
M5 MacBook Pro

RIP, MacBook Ultra

Monday October 19, 2026 9:37 am PDT by
Apple today sent out invites for an experience in Los Angeles on Wednesday, October 28, and the "Pro and tell" tagline on the invitation likely means that the rumored MacBook models with touch-enabled OLED displays will stick with MacBook Pro branding instead of the once-rumored "MacBook Ultra" name. The long-rumored "iPhone Ultra" ended up being named iPhone Duo, so speculation that Apple...
iPhone Duo Trio

Here's What Apple's Apps Look Like on the iPhone Duo

Tuesday October 20, 2026 11:12 am PDT by
With just three days to go until the iPhone Duo is released, Apple is getting ready for the launch. Behind the scenes, the App Store now has screenshots of Apple's built-in apps running on the Duo. We've seen some apps in marketing materials, but images of the ones we haven't seen give us an idea of what it will be like using the iPhone Duo day to day. Many apps are shown in landscape...
Latest Stories
Does the iPhone Duo Run Hot? Here's What Reviews Found
Does the iPhone Duo Run Hot? Here's What Reviews Found
47 minutes ago
Apple Music's New Look is Now Live on Apple's Website
Apple Music's New Look is Now Live on Apple's Website
1 hour ago
Anthropic Launches Claude Duet, a Proactive AI Agent
Anthropic Launches Claude Duet, a Proactive AI Agent
2 hours ago
What 32,000 Folds Did to the iPhone Duo's Hinge
What 32,000 Folds Did to the iPhone Duo's Hinge
3 hours ago
iPhone Duo's Hidden FaceTime Camera Takes 'Trash' Photos
iPhone Duo's Hidden FaceTime Camera Takes 'Trash' Photos
4 hours ago
iPhone Duo Has 'Edge Light' Feature That Debuted on Macs Last Year
iPhone Duo Has 'Edge Light' Feature That Debuted on Macs Last Year
5 hours ago
Apple Support App Updated for iPhone Duo's Larger Display
Apple Support App Updated for iPhone Duo's Larger Display
5 hours ago
Amazon Sweetens the Deal on Entry-Level 16-Inch MacBook Pro With $570 Off
Amazon Sweetens the Deal on Entry-Level 16-Inch MacBook Pro With $570 Off
5 hours ago
iPhone Duo Tips Over on MagSafe Stands When Unfolded
iPhone Duo Tips Over on MagSafe Stands When Unfolded
5 hours ago
Apple Music's New Look Officially Announced
Apple Music's New Look Officially Announced
7 hours ago
iPhone Duo Supports Apple Pencil Starting With iOS 27.2
iPhone Duo Supports Apple Pencil Starting With iOS 27.2
8 hours ago
iPhone Duo Accessories Roundup: Cases and Screen Protectors From OtterBox, ZAGG, and More
iPhone Duo Accessories Roundup: Cases and Screen Protectors From OtterBox, ZAGG, and More
8 hours ago
Apple Stores Will Have 'Limited' Availability of iPhone Duo for Walk-In Customers
Apple Stores Will Have 'Limited' Availability of iPhone Duo for Walk-In Customers
9 hours ago
iPhone Duo Reviews Explain Why Device is Both 'Fun' and 'Frustrating'
iPhone Duo Reviews Explain Why Device is Both 'Fun' and 'Frustrating'
9 hours ago
Apple Says 'Reachability' Feature Coming to iPhone Duo Later This Year
Apple Says 'Reachability' Feature Coming to iPhone Duo Later This Year
10 hours ago
Loop Capital Cuts Apple Rating Over iPhone Sales Outlook
Loop Capital Cuts Apple Rating Over iPhone Sales Outlook
14 hours ago
Apple Stores in Bordeaux and Lille Looted During French Protests
Apple Stores in Bordeaux and Lille Looted During French Protests
14 hours ago
Bluesound Adds Native Apple Music Support
Bluesound Adds Native Apple Music Support
15 hours ago
Apple CEO John Ternus Explains What Makes Good Product Design
Apple CEO John Ternus Explains What Makes Good Product Design
16 hours ago
UK Proposes New Ways to Help Apple Pay Rivals
UK Proposes New Ways to Help Apple Pay Rivals
18 hours ago
WhatsApp Developing In-App Browser for All Chat Links on iPhone
WhatsApp Developing In-App Browser for All Chat Links on iPhone
19 hours ago
Apple's App Store Chief Explains Its Push for Premium Games
Apple's App Store Chief Explains Its Push for Premium Games
19 hours ago
Apple Could Owe Even More After $5.7 Billion Patent Verdict
Apple Could Owe Even More After $5.7 Billion Patent Verdict
19 hours ago
Skyrim Comes to Apple Silicon Macs With New Unofficial Installer
Skyrim Comes to Apple Silicon Macs With New Unofficial Installer
20 hours ago
Apple Highlights Mac and iPad Use in Paris Design Exhibition
Apple Highlights Mac and iPad Use in Paris Design Exhibition
20 hours ago
Apple Seeks 6G Modem Engineers as It Plans for Post-5G iPhones
Apple Seeks 6G Modem Engineers as It Plans for Post-5G iPhones
23 hours ago
First iPhone Duo Unboxing Video Appears Ahead of Friday Launch
First iPhone Duo Unboxing Video Appears Ahead of Friday Launch
23 hours ago
Perplexity Computer Can Now Run Fully Locally on Mac
Perplexity Computer Can Now Run Fully Locally on Mac
1 day ago
Apple's Touchscreen OLED MacBook Pro: Everything We Know
Apple's Touchscreen OLED MacBook Pro: Everything We Know
1 day ago
iPad Mini 8 Expected Next Week With These 10 New Features
iPad Mini 8 Expected Next Week With These 10 New Features
1 day ago