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 18 pro max prepare

iPhone 18 Pro Max Requires 'Prepare to Ship' Battery Drain Before Shipping

Friday September 18, 2026 4:27 pm PDT by
The iPhone 18 Pro Max has a battery capacity over 20 watt-hours, which means there are additional shipping requirements. If an iPhone 18 Pro Max needs to be shipped somewhere, its maximum battery capacity has to be limited through firmware. According to Apple, the iPhone 18 Pro Max uses an "innovative battery-firmware solution" that limits battery capacity to below 20Wh between when the...
8 CarPlay Features in iOS 27 Feature

Which iOS 27 CarPlay Features Actually Work in Your Car?

Thursday September 17, 2026 4:17 am PDT by
In iOS 27, available now, CarPlay gets its biggest update in years, but some features depend on what type of car you have rather than your iPhone model. Some of the biggest additions won't do anything in the vast majority of vehicles on the road today. Here's how the new features pan out. Works in Any CarPlay Vehicle Custom widgets: In iOS 27, CarPlay is no longer limited to Apple's handful ...
imac video apple feature

Apple Releasing Two New Macs Next Week

Friday September 18, 2026 10:07 am PDT by
Last month, Apple announced new Mac mini and Mac Studio models, and the computers are finally set to launch this coming Tuesday, September 22. The new Mac mini is available with M6 and M5 Pro chip options, while the new Mac Studio can be configured with M5 Max or M5 Ultra chips. To learn more, read our coverage:Apple Announces New Mac Mini With M6 and M5 Pro Chips and More Apple Unveils ...
Latest Stories
M6 Pro Chip Result on Geekbench is Likely Fake
M6 Pro Chip Result on Geekbench is Likely Fake
12 hours ago
Apple Watch Ultra 4 Sees First Discount After Launch, Now $779.99 on Amazon
Apple Watch Ultra 4 Sees First Discount After Launch, Now $779.99 on Amazon
15 hours ago
Top Stories: iOS 27 and macOS Golden Gate Out Now, Siri AI Waitlist, and More
Top Stories: iOS 27 and macOS Golden Gate Out Now, Siri AI Waitlist, and More
17 hours ago
Apple Exec Says 'Hold Us Accountable' on iPhone Duo Crease
Apple Exec Says 'Hold Us Accountable' on iPhone Duo Crease
1 day ago
iPhone 18 Pro Max Requires 'Prepare to Ship' Battery Drain Before Shipping
iPhone 18 Pro Max Requires 'Prepare to Ship' Battery Drain Before Shipping
1 day ago
Hands-On With the Apple Watch Series 12
Hands-On With the Apple Watch Series 12
1 day ago
M5 Ultra and M6 Chip Benchmark Results Reveal Graphics Performance
M5 Ultra and M6 Chip Benchmark Results Reveal Graphics Performance
1 day ago
iPhone 18 Pro Max in U.S. Has Qualcomm's Snapdragon X80 Modem
iPhone 18 Pro Max in U.S. Has Qualcomm's Snapdragon X80 Modem
1 day ago
Apple Releases Xcode 27.1 Beta With iPhone Duo Support
Apple Releases Xcode 27.1 Beta With iPhone Duo Support
2 days ago
Apple Watch Series 12 vs. Ultra 4 Buyer's Guide
Apple Watch Series 12 vs. Ultra 4 Buyer's Guide
2 days ago
MacRumors Giveaway: Win an iPhone Duo From iMazing
MacRumors Giveaway: Win an iPhone Duo From iMazing
2 days ago
'Shop Different': Apple Retail Pioneer Ron Johnson Shares the Inside Story
'Shop Different': Apple Retail Pioneer Ron Johnson Shares the Inside Story
2 days ago
Apple Teams Up With ROSÉ for iPhone 18 Pro Camera Ad
Apple Teams Up With ROSÉ for iPhone 18 Pro Camera Ad
2 days ago
The MacRumors Show: Is the iPhone Duo Actually Worth It?
The MacRumors Show: Is the iPhone Duo Actually Worth It?
2 days ago
Apple Designers Explain the Thinking Behind iPhone Duo
Apple Designers Explain the Thinking Behind iPhone Duo
2 days ago
Are iPhone 17 Pro Cases Compatible With iPhone 18 Pro? Here's What Apple Says
Are iPhone 17 Pro Cases Compatible With iPhone 18 Pro? Here's What Apple Says
2 days ago
Apple Supplier Subsidiary Considering U.S. Flash Memory Factory
Apple Supplier Subsidiary Considering U.S. Flash Memory Factory
2 days ago
Apple Launch Day Deals on iPhone 18 Pro, AirPods 5, Apple Watch Series 12, and More
Apple Launch Day Deals on iPhone 18 Pro, AirPods 5, Apple Watch Series 12, and More
2 days ago
iPhone 18 Pro Teardown Reveals How Apple Shrunk the Dynamic Island
iPhone 18 Pro Teardown Reveals How Apple Shrunk the Dynamic Island
2 days ago
iPhone 18 Pro Demand Stronger Than Expected
iPhone 18 Pro Demand Stronger Than Expected
2 days ago
Fan Site Lets You 'Design the Next iPhone'
Fan Site Lets You 'Design the Next iPhone'
2 days ago
Apple Stores Have a New 'Hello' Easter Egg, Here's Why
Apple Stores Have a New 'Hello' Easter Egg, Here's Why
2 days ago
iPhone 18 Pro: The New Features You Should Try First
iPhone 18 Pro: The New Features You Should Try First
2 days ago
iPhone 18 Pro: Using the New Variable Aperture Lens
iPhone 18 Pro: Using the New Variable Aperture Lens
2 days ago
Forgot to Pre-Order iPhone 18 Pro? Apple Store Pickup Available Today at Most Locations
Forgot to Pre-Order iPhone 18 Pro? Apple Store Pickup Available Today at Most Locations
2 days ago
Apple CEO John Ternus Teases iPhone 18 Pro Launch Day
Apple CEO John Ternus Teases iPhone 18 Pro Launch Day
2 days ago
First iPhone 18 Pro, Apple Watch Series 12, Apple Watch Ultra 4 and AirPods 5 Orders Arriving to Customers
First iPhone 18 Pro, Apple Watch Series 12, Apple Watch Ultra 4 and AirPods 5 Orders Arriving to Customers
2 days ago
iPhone 18 Pro Launching Tomorrow With These 10 New Features
iPhone 18 Pro Launching Tomorrow With These 10 New Features
2 days ago
How to Get the New 3-Month Trial of Apple One Premier ($120 Value)
How to Get the New 3-Month Trial of Apple One Premier ($120 Value)
2 days ago
New iPhone 18 Pro Models Will Have Day One Update
New iPhone 18 Pro Models Will Have Day One Update
2 days ago