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

Apple TV 4K HomeView HomePod Mini tweaked

New Apple TV 4K, HomeView, and HomePod Mini: 16 Details Just Leaked

Sunday October 11, 2026 12:56 pm PDT by
Just two days before Apple's "Welcome home" experience in New York, Bloomberg's Mark Gurman has leaked several details about the new products set to be unveiled, including an all-new smart home hub, a HomePod mini 2, and a new Apple TV 4K. Here is an all-in-one summary of the details shared by Gurman:Apple's home hub with a touch-enabled display will be named HomeView, seemingly confirming a ...
apple welcome home event

Apple Product Launch Announced for October 13: 'Welcome Home'

Thursday October 8, 2026 9:04 am PDT by
Apple today announced an upcoming product launch that will take place on Tuesday, October 13. We are expecting Apple's announcement to focus on new smart home products, including the long-rumored smart home hub, a new Apple TV 4K, and a refreshed HomePod mini. Subscribe to the MacRumors YouTube channel for more videos. The home hub is an all-new device that's like a cross between an iPad and...
MacBook Pro Ultra Feature 1

Apple to Launch Touchscreen OLED MacBook Pro and OLED iPad mini on October 27

Thursday October 8, 2026 1:31 pm PDT by
Apple will introduce new OLED touchscreen MacBook Pro models and an OLED iPad mini "on or around" Tuesday, October 27, reports Bloomberg. The launch will also include an M6 14-inch MacBook Pro and an M6 iMac. The October 27 follows Apple's October 13 debut of a new smart home hub, a revamped Apple TV 4K, and a refreshed HomePod mini. Earlier this month, MacRumors reported that Apple would do ...
Latest Stories
Apple 'Welcome Home' Launch: Everything to Expect Tomorrow
Apple 'Welcome Home' Launch: Everything to Expect Tomorrow
29 minutes ago
You Can Now Set Up Your iPhone Duo Pre-Order - Do It Before Friday
You Can Now Set Up Your iPhone Duo Pre-Order - Do It Before Friday
34 minutes ago
Apple Plans Two-Day Event to Showcase Trio of New Macs and iPad Mini
Apple Plans Two-Day Event to Showcase Trio of New Macs and iPad Mini
2 hours ago
Apple and Pokémon Tease Special Pikachu-Themed Beats Pill Speaker
Apple and Pokémon Tease Special Pikachu-Themed Beats Pill Speaker
2 hours ago
Apple Announces 'Indie Games Week' on App Store
Apple Announces 'Indie Games Week' on App Store
3 hours ago
Amazon Discounting 2026 MacBook Pro by as Much as $600 This Week
Amazon Discounting 2026 MacBook Pro by as Much as $600 This Week
3 hours ago
Apple Watch Ultra 1 vs. Ultra 4 Buyer's Guide: Is It Worth Upgrading?
Apple Watch Ultra 1 vs. Ultra 4 Buyer's Guide: Is It Worth Upgrading?
4 hours ago
Apple Watch SE 3 Available From Just $199.99 on Amazon
Apple Watch SE 3 Available From Just $199.99 on Amazon
4 hours ago
Tim Cook Visits China for the Third Time in 2026
Tim Cook Visits China for the Third Time in 2026
4 hours ago
OLED iPad Mini Could Be $200 More Expensive Than Current Model
OLED iPad Mini Could Be $200 More Expensive Than Current Model
7 hours ago
Apple Launches Special Edition AirPods 5 in India
Apple Launches Special Edition AirPods 5 in India
7 hours ago
New Apple TV 4K and HomePod Mini 2 Pre-Orders Expected to Begin This Week
New Apple TV 4K and HomePod Mini 2 Pre-Orders Expected to Begin This Week
14 hours ago
New Apple TV 4K, HomeView, and HomePod Mini: 16 Details Just Leaked
New Apple TV 4K, HomeView, and HomePod Mini: 16 Details Just Leaked
22 hours ago
New Entry-Level iPad Not Expected Until Early 2027
New Entry-Level iPad Not Expected Until Early 2027
1 day ago
Apple Plans Major iPhone Duo Retail Showcase, But Supply Will Be Limited
Apple Plans Major iPhone Duo Retail Showcase, But Supply Will Be Limited
1 day ago
Apple TV 4K Getting A19 Chip and a Potentially Easier-to-Find Siri Remote
Apple TV 4K Getting A19 Chip and a Potentially Easier-to-Find Siri Remote
1 day ago
New Mac Mini and Mac Studio Receive Up to $200 Price Cuts at Amazon
New Mac Mini and Mac Studio Receive Up to $200 Price Cuts at Amazon
1 day ago
Apple HomeView Smart Hub to Ship in Mid-November in Four Colors
Apple HomeView Smart Hub to Ship in Mid-November in Four Colors
1 day ago
New Apple TV 4K and HomePod Mini to Ship on October 30
New Apple TV 4K and HomePod Mini to Ship on October 30
1 day ago
AirPods Max 2 Available for $429 in All Colors on Amazon
AirPods Max 2 Available for $429 in All Colors on Amazon
1 day ago
Rumor: Apple to Announce New Partnership With ADT
Rumor: Apple to Announce New Partnership With ADT
2 days ago
AirPods 5 vs. AirPods 5 With Wireless Charging Case Buyer's Guide
AirPods 5 vs. AirPods 5 With Wireless Charging Case Buyer's Guide
2 days ago
Accessory Deals This Weekend: Save on TVs, Headphones, and Smart Home Gear
Accessory Deals This Weekend: Save on TVs, Headphones, and Smart Home Gear
2 days ago
Apple's All-New Home Hub Will Be Revealed October 13: What to Expect
Apple's All-New Home Hub Will Be Revealed October 13: What to Expect
2 days ago
Apple Announcing HomePod Mini 2 Next Week With These New Features
Apple Announcing HomePod Mini 2 Next Week With These New Features
2 days ago
A New Apple TV 4K is Finally Coming on Tuesday
A New Apple TV 4K is Finally Coming on Tuesday
2 days ago
Top Stories: Apple's 'Welcome Home' Launch on October 13 and More
Top Stories: Apple's 'Welcome Home' Launch on October 13 and More
2 days ago
Apple Stores Will Add Your Name to iPhone Duo's Startup Screen
Apple Stores Will Add Your Name to iPhone Duo's Startup Screen
3 days ago
SpaceX Inches Closer to Becoming a U.S. Carrier
SpaceX Inches Closer to Becoming a U.S. Carrier
3 days ago
Apple Potentially Behind 'HomeView' Trademark Filed Alongside 'homeOS' Last Year
Apple Potentially Behind 'HomeView' Trademark Filed Alongside 'homeOS' Last Year
3 days ago