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...
iPhone Handoff Feature

Verizon Will Charge $10 a Month for iPhone Handoff

Friday October 16, 2026 4:37 pm PDT by
Verizon plans to charge customers $10 per month for the iPhone Handoff feature that Apple added in iOS 27. iPhone Handoff allows one phone number to be shared across two separate iPhones. Pricing was included in Verizon's iPhone Duo announcement today, with the carrier confirming iPhone Handoff will work with the iPhone Duo and the iPhone 18 Pro models. Verizon will support iPhone Handoff,...
Black Apple Event Logo

Apple Now Inviting Media to October 28 'Launch Experience'

Thursday October 15, 2026 4:13 am PDT by
Apple has begun inviting selected members of the media to a product launch experience in Los Angeles on Wednesday, October 28, according to Bloomberg's Mark Gurman. In a post on X, Gurman described the gathering as an "all-day product launch experience" for touchscreen MacBooks, a new iPad mini, and Macs equipped with M6 chips. Gurman previously reported that Apple would introduce the...
Latest Stories
Top Stories: Apple HomeView, New Apple TV and HomePod mini, and Sold-Out iPhone Duo
Top Stories: Apple HomeView, New Apple TV and HomePod mini, and Sold-Out iPhone Duo
7 hours ago
Verizon Will Charge $10 a Month for iPhone Handoff
Verizon Will Charge $10 a Month for iPhone Handoff
20 hours ago
Apple Calls iPhone Duo Demand 'Extraordinary' After Orders Slip to 2027
Apple Calls iPhone Duo Demand 'Extraordinary' After Orders Slip to 2027
21 hours ago
New App Store Rules Target AI Deepfakes and Nudify Apps
New App Store Rules Target AI Deepfakes and Nudify Apps
21 hours ago
Didn't Pre-Order Apple's HomeView? Here's How Long the Wait is Now
Didn't Pre-Order Apple's HomeView? Here's How Long the Wait is Now
1 day ago
Apple's $79 iPhone Duo Case Sticks On With Adhesive
Apple's $79 iPhone Duo Case Sticks On With Adhesive
1 day ago
Apple TV 4K and HomePod Mini Price Increases 'Much More Striking' Than New Features
Apple TV 4K and HomePod Mini Price Increases 'Much More Striking' Than New Features
1 day ago
The MacRumors Show: Was HomeView Worth the Wait?
The MacRumors Show: Was HomeView Worth the Wait?
1 day ago
Apple Refers to HomeView as 'HomePodDevice' in Legal Document
Apple Refers to HomeView as 'HomePodDevice' in Legal Document
1 day ago
Apple Pre-Orders Kick Off With First Discounts on HomeView and Apple TV 4K
Apple Pre-Orders Kick Off With First Discounts on HomeView and Apple TV 4K
1 day ago
Developers Question Scope of Potential Apple Antitrust Settlement
Developers Question Scope of Potential Apple Antitrust Settlement
1 day ago
iPhone Duo Resold for $5,000 on eBay After Selling Out
iPhone Duo Resold for $5,000 on eBay After Selling Out
1 day ago
Massive Discounts Hit 2026 MacBook Pro With Up to $800 Off
Massive Discounts Hit 2026 MacBook Pro With Up to $800 Off
1 day ago
iPhone Duo is Sold Out for Christmas as Shipping Estimates Slip to 2027
iPhone Duo is Sold Out for Christmas as Shipping Estimates Slip to 2027
1 day ago
Didn't Pre-Order an iPhone Duo Yet? Wait Times Are Significant Now
Didn't Pre-Order an iPhone Duo Yet? Wait Times Are Significant Now
1 day ago
First Apple TV 4K Pre-Order Discount Arrives at Amazon
First Apple TV 4K Pre-Order Discount Arrives at Amazon
1 day ago
iPhone Duo Pre-Order Deals: The Best Carrier Offers From AT&T and T-Mobile
iPhone Duo Pre-Order Deals: The Best Carrier Offers From AT&T and T-Mobile
1 day ago
iPhone Duo Now Available to Pre-Order From Apple
iPhone Duo Now Available to Pre-Order From Apple
1 day ago
iPhone 18 Pro vs. iPhone Duo Buyer's Guide: Which Should You Choose?
iPhone 18 Pro vs. iPhone Duo Buyer's Guide: Which Should You Choose?
1 day ago
Apple Store Down Ahead of iPhone Duo Pre-Orders
Apple Store Down Ahead of iPhone Duo Pre-Orders
1 day ago
Oops, Apple's Website Just Hinted at iPad Mini 8
Oops, Apple's Website Just Hinted at iPad Mini 8
2 days ago
OLED MacBook Pro Won't Get M7 Chips Until Late 2027
OLED MacBook Pro Won't Get M7 Chips Until Late 2027
2 days ago
Apple Pledged $25 Million to Trump's White House Ballroom
Apple Pledged $25 Million to Trump's White House Ballroom
2 days ago
Touchscreen MacBook Pro Could Launch on November 6
Touchscreen MacBook Pro Could Launch on November 6
2 days ago
New Withings Users Must Pay $99/Year for Apple Health Syncing
New Withings Users Must Pay $99/Year for Apple Health Syncing
2 days ago
Meta and Apple Bring Muse Spark Open AI Model to Mac Studio
Meta and Apple Bring Muse Spark Open AI Model to Mac Studio
2 days ago
iPad Mini 8: Apple Has Tested Both 60Hz and 120Hz ProMotion Displays
iPad Mini 8: Apple Has Tested Both 60Hz and 120Hz ProMotion Displays
2 days ago
Apple TV 4K 2022 vs. 2026 Buyer's Guide: All Differences Compared
Apple TV 4K 2022 vs. 2026 Buyer's Guide: All Differences Compared
2 days ago
Apple CEO John Ternus on Early Foldables: 'Kind of Cheap and Crappy'
Apple CEO John Ternus on Early Foldables: 'Kind of Cheap and Crappy'
2 days ago
Greg Joswiak Says Apple Isn't Focused on Making AI for 'Lunatic Fringe'
Greg Joswiak Says Apple Isn't Focused on Making AI for 'Lunatic Fringe'
2 days ago