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 design award 2025

Apple Announces 2025 Design Award Winners Ahead of WWDC 2025

Tuesday June 3, 2025 10:14 am PDT by
As we wait for WWDC to kick off next Monday, Apple today announced the winners of its annual Apple Design Awards, recognizing apps and games for their innovation, ingenuity, and technical achievement. The 2025 Apple Design Award winners are listed below, with one app and one game selected per category: Delight and Fun - CapWords (App) and Balatro (Game) Innovation - Play (App) and PBJ -...
ipod nano 7 ios project

iPod Nano Can Finally Run iOS

Sunday November 29, 2026 10:10 am PST by
A new, unofficial software project allows Apple's seventh-generation iPod nano to run iOS and classic iPhone apps. Despite looking like a miniature iPod touch, the device originally ran its own operating system with an unusual, iOS 6-like interface and round app icons, without support for iPhone apps. At just 5.4mm thick and weighing 31 grams, it remains Apple's thinnest standalone device...
Apple 2026 Black Friday Event Hero

Apple's Official 2026 Black Friday Offer Starts Rolling Out

Thursday November 26, 2026 8:37 am PST by
Apple's annual four-day Black Friday through Cyber Monday shopping event is now live in Australia, New Zealand, and Thailand, and it will continue to roll out across Europe, the U.S., and Canada as the calendar turns to Friday, November 27 around the world. In the U.S., Apple's terms and conditions say the promotion begins on November 27 at 12 a.m. Pacific Time and ends on November 30 at...
Latest Stories
WhatsApp Drops Support for Older iPhones, Warns About Security Vulnerabilities
WhatsApp Drops Support for Older iPhones, Warns About Security Vulnerabilities
29 minutes ago
Best Cyber Monday Accessory Discounts From Amazon, Anker, Sonos, and More
Best Cyber Monday Accessory Discounts From Amazon, Anker, Sonos, and More
2 hours ago
Apple Podcasts Now Has Its Own Year-End Replay
Apple Podcasts Now Has Its Own Year-End Replay
2 hours ago
Apple Music's Most Popular Song in 2026 Revealed
Apple Music's Most Popular Song in 2026 Revealed
3 hours ago
Last Chance Holiday Streaming Deals: Apple TV and Disney+/Hulu Offers End Today
Last Chance Holiday Streaming Deals: Apple TV and Disney+/Hulu Offers End Today
3 hours ago
Apple Music Replay 2026 Now Fully Available
Apple Music Replay 2026 Now Fully Available
3 hours ago
Apple Pay Supporting the Fight Against AIDS This Week
Apple Pay Supporting the Fight Against AIDS This Week
4 hours ago
Apple Watch Ultra 4 Cyber Monday Deal Takes $150 Off Select Models
Apple Watch Ultra 4 Cyber Monday Deal Takes $150 Off Select Models
4 hours ago
Apple Announces News Publisher Deals to Improve Siri AI Answers
Apple Announces News Publisher Deals to Improve Siri AI Answers
5 hours ago
Apple's New (RED) Products Available for Pickup a Day Early
Apple's New (RED) Products Available for Pickup a Day Early
5 hours ago
M4 iPad Air Drops to Best Ever Post-Hike Prices for Cyber Monday
M4 iPad Air Drops to Best Ever Post-Hike Prices for Cyber Monday
5 hours ago
Apple's New (RED) Accessories Require Buying New Devices
Apple's New (RED) Accessories Require Buying New Devices
5 hours ago
Best Apple Cyber Monday Deals: Record Low Prices on AirPods, Macs, and More
Best Apple Cyber Monday Deals: Record Low Prices on AirPods, Macs, and More
54 minutes ago
Apple Announces Five New (RED) Products
Apple Announces Five New (RED) Products
6 hours ago
Apple Could Be Forced to Allow Rival App Stores in Yet Another Country
Apple Could Be Forced to Allow Rival App Stores in Yet Another Country
8 hours ago
iPod Nano Can Finally Run iOS
iPod Nano Can Finally Run iOS
1 day ago
Apple Gift Card Purchases Over $100 on Amazon Include $15 Credit
Apple Gift Card Purchases Over $100 on Amazon Include $15 Credit
1 day ago
AirPods Max 2 Drop to Record Low $399 Price for Cyber Monday
AirPods Max 2 Drop to Record Low $399 Price for Cyber Monday
1 day ago
Apple Now Aims to Repair Rather Than Replace iPhone Duos With Cracked Screens
Apple Now Aims to Repair Rather Than Replace iPhone Duos With Cracked Screens
2 days ago
Here Are the Best Apple Black Friday Leftover Deals You Can Get Today
Here Are the Best Apple Black Friday Leftover Deals You Can Get Today
2 days ago
HomePod Mini 2 in (RED) Seemingly Spotted Ahead of Announcement
HomePod Mini 2 in (RED) Seemingly Spotted Ahead of Announcement
3 days ago
Apple's M6 and PROLED MacBook Pro Reach New Low Prices for Black Friday
Apple's M6 and PROLED MacBook Pro Reach New Low Prices for Black Friday
3 days ago
The MacRumors Show: iPhone Air 2 and iPhone 18 Are Coming
The MacRumors Show: iPhone Air 2 and iPhone 18 Are Coming
3 days ago
Apple Store in Brisbane Reopening Next Month With New Design
Apple Store in Brisbane Reopening Next Month With New Design
3 days ago
The 60+ Best Black Friday Accessory Deals on iPhone Chargers, TVs, Headphones, and More
The 60+ Best Black Friday Accessory Deals on iPhone Chargers, TVs, Headphones, and More
2 days ago
GTA VI Now (Barely) Running on Apple Silicon Macs
GTA VI Now (Barely) Running on Apple Silicon Macs
3 days ago
The Best Black Friday Streaming Deals on Apple TV, Disney+, and More
The Best Black Friday Streaming Deals on Apple TV, Disney+, and More
3 days ago
Apple TV's 'Carême' Wins International Emmy for Best Drama
Apple TV's 'Carême' Wins International Emmy for Best Drama
3 days ago
iPhone 18 Production Delay Leaves Apple Little Time Before Launch
iPhone 18 Production Delay Leaves Apple Little Time Before Launch
3 days ago
The Best Black Friday AirPods Deals Still Available
The Best Black Friday AirPods Deals Still Available
3 days ago