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

iphone 17 pro max battery 1 year

Three Years of 80% Charge Limits on iPhone: The Results

Tuesday October 6, 2026 12:59 pm PDT by
Since 2023, Apple's newer iPhones have had an 80 percent charge limit for those who want to extend battery lifespan. Charging to 80 percent instead of 100 percent is supposed to put less stress on the battery, improving longevity. For the last three years, I've used that setting on my iPhone. I started with the iPhone 15 Pro Max, then did the iPhone 16 Pro Max, and most recently, the iPhone...
MagSafe 3 Cable Midnight Feature

Apple Releases MagSafe 3 Charging Cable Firmware Update

Monday October 5, 2026 5:59 am PDT by
For the first time since February 2023, Apple has released a firmware update for the MagSafe 3 charging cable for the MacBook Pro and MacBook Air. Specifically, Apple last week released firmware version 3.2.0 for the USB-C to MagSafe 3 Cable. The previous firmware version for the cable was 3.1.12. It is unclear what is included in the latest firmware, as Apple does not publish release...
Black Apple Event Logo

Sources: Apple Planning Two Sets of Product Launches in October

Monday October 5, 2026 7:24 pm PDT by
Bloomberg's Mark Gurman recently reported that Apple plans to unveil an all-new home hub, a new HomePod mini, and a new Apple TV 4K on Tuesday, October 13, and MacRumors has since learned about another launch slated for later in the month. Apple is planning to unveil additional new products in the final week of October, according to multiple sources familiar with the matter. While we do...
Latest Stories
Amazon Unveils New iPad Rivals With Alexa+ and Google Play
Amazon Unveils New iPad Rivals With Alexa+ and Google Play
41 minutes ago
Missed Prime Day? You Can Still Score Big on Apple Devices Today
Missed Prime Day? You Can Still Score Big on Apple Devices Today
1 hour ago
Apple's Cheapest 16-Inch MacBook Pro Just Got a Massive $563 Discount on Amazon
Apple's Cheapest 16-Inch MacBook Pro Just Got a Massive $563 Discount on Amazon
1 hour ago
Apple Still Expected to Announce Three New Products on October 13
Apple Still Expected to Announce Three New Products on October 13
2 hours ago
Leaker Jon Prosser Pushes Back as Apple Seeks His YouTube Data
Leaker Jon Prosser Pushes Back as Apple Seeks His YouTube Data
3 hours ago
iPhone Air 2 Could Be as Thin as an Unfolded iPhone Duo
iPhone Air 2 Could Be as Thin as an Unfolded iPhone Duo
4 hours ago
New iPad Mini Rumored to Have 60Hz OLED Display Ahead of Launch
New iPad Mini Rumored to Have 60Hz OLED Display Ahead of Launch
6 hours ago
Gurman: OLED MacBook Pro Won't Be 'Significantly Thinner'
Gurman: OLED MacBook Pro Won't Be 'Significantly Thinner'
7 hours ago
Microsoft Launches $2,599 Surface Laptop Ultra to Take on MacBook Pro
Microsoft Launches $2,599 Surface Laptop Ultra to Take on MacBook Pro
15 hours ago
Google's SynthID AI Detector is Now Available to Everyone
Google's SynthID AI Detector is Now Available to Everyone
16 hours ago
ChatGPT Gets GPT-6 and New Intelligent UI With Visual Answers
ChatGPT Gets GPT-6 and New Intelligent UI With Visual Answers
17 hours ago
Get AirPods Pro 3 for $179, Apple Watch for $199, and More Before Prime Day Ends Today
Get AirPods Pro 3 for $179, Apple Watch for $199, and More Before Prime Day Ends Today
17 hours ago
Apple Watch Series 12 and Ultra 4 Score 4/10 for Repairability
Apple Watch Series 12 and Ultra 4 Score 4/10 for Repairability
18 hours ago
Apple Launches Creative Labs Program With The King's Trust
Apple Launches Creative Labs Program With The King's Trust
18 hours ago
Apple Watch Series 12, Ultra 4 Owners Report Skin Irritation
Apple Watch Series 12, Ultra 4 Owners Report Skin Irritation
20 hours ago
Boston's MBTA Testing New Charlie Card With Apple Wallet Support
Boston's MBTA Testing New Charlie Card With Apple Wallet Support
22 hours ago
Manchester's Bee Card Now Fully Supported in Apple Wallet
Manchester's Bee Card Now Fully Supported in Apple Wallet
23 hours ago
You Can Get Up to $149 Off Every New Mac Mini During Prime Day
You Can Get Up to $149 Off Every New Mac Mini During Prime Day
1 day ago
Best Buy Takes $260 Off All iPhone Air Models During Techtober Sale
Best Buy Takes $260 Off All iPhone Air Models During Techtober Sale
1 day ago
The Best Anker Prime Day Deals: Score Big on MagSafe Chargers and More
The Best Anker Prime Day Deals: Score Big on MagSafe Chargers and More
1 day ago
12 New Things to Expect From Apple in October
12 New Things to Expect From Apple in October
1 day ago
Prime Day Offers Best TV Prices of the Year From Samsung, Sony, and More
Prime Day Offers Best TV Prices of the Year From Samsung, Sony, and More
1 day ago
First Look at LG's Smart Home Products Made With Apple
First Look at LG's Smart Home Products Made With Apple
1 day ago
Apple Watch Ultra 3 and Ultra 4 See Record Discounts During Prime Day
Apple Watch Ultra 3 and Ultra 4 See Record Discounts During Prime Day
1 day ago
Apple Drops Intel Macs From Magic Mouse/Trackpad Compatibility Lists
Apple Drops Intel Macs From Magic Mouse/Trackpad Compatibility Lists
1 day ago
Apple Reportedly Waiting on Samsung for Ultimate Bezel-Free iPhone Display
Apple Reportedly Waiting on Samsung for Ultimate Bezel-Free iPhone Display
1 day ago
Apple's Own Home Security Camera Still Coming Next Year
Apple's Own Home Security Camera Still Coming Next Year
1 day ago
Unfolded iPhone Duo Lets You Preview Documents in a Two-Page Layout
Unfolded iPhone Duo Lets You Preview Documents in a Two-Page Layout
1 day ago
Formula 1 Coverage on Apple TV to Get Dolby Atmos Later This Month
Formula 1 Coverage on Apple TV to Get Dolby Atmos Later This Month
1 day ago
LG Making Doorbell, Lock, and Cameras for Apple's Home Hub
LG Making Doorbell, Lock, and Cameras for Apple's Home Hub
2 days ago