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 Kukatpally Wallpaper

Apple Just Released Five New Products

Wednesday December 2, 2026 6:12 am PST by
Apple this week released five new (RED) products, which are available online and at Apple Stores in the U.S. and dozens of other countries. The five new products with (RED) editions:AirPods Max 2 ($549) HomePod mini 2 ($149) Apple Watch Series 12 (Titanium) ($699) AirPods Pro 3 with Wrist Strap ($269) AirTag 2 with AirTag FineWoven Key Ring ($59)Apple is now using (RED) branding instead...
macbook proled candy

PROLED MacBook Pro Receives Massive $1,000 Amazon Discount [Update: Gone]

Wednesday December 2, 2026 6:14 am PST by
Apple's MacBook Pro with PROLED XDR is seeing a massive $1,000 discount right now on Amazon, undercutting the Black Friday price by over $700. Note: MacRumors is an affiliate partner with some of these vendors. When you click a link and make a purchase, we may receive a small payment, which helps us keep the site running. The model in question is the 16-inch PROLED MacBook Pro with 36GB...
google authenticator

PSA: Don't Update Google Authenticator on iOS 27 Right Now [Update: Fixed]

Monday November 30, 2026 6:06 pm PST by
Google Authenticator users should avoid installing the latest 5.2.2 update because it seems to be crashing on launch. Multiple people on Google's support forums say that Google Authenticator 5.2.2 crashes on iOS 27, iOS 27.2, iOS 27.2.1, and the iOS 27.3 beta. Users are unable to access two-factor authentication codes for logins because the app doesn't launch. Complaints about the update...
Latest Stories
Some M5 Macs Have a Studio Display XDR Problem
Some M5 Macs Have a Studio Display XDR Problem
24 minutes ago
Cyber Week iPhone Deals: Get an iPhone Duo at No Cost for the Holidays
Cyber Week iPhone Deals: Get an iPhone Duo at No Cost for the Holidays
40 minutes ago
Apple's Former Software Design Chief Alan Dye on Why He Joined Meta
Apple's Former Software Design Chief Alan Dye on Why He Joined Meta
3 hours ago
Meta Considers iPhone Rival and Revives Smartwatch Plans
Meta Considers iPhone Rival and Revives Smartwatch Plans
3 hours ago
iPhone 20 Pro Titanium Rumors Grow as Material Orders Rise
iPhone 20 Pro Titanium Rumors Grow as Material Orders Rise
4 hours ago
Apple Announces 'The Morning Show' Season 5 Release Date
Apple Announces 'The Morning Show' Season 5 Release Date
5 hours ago
Apple Pay Promo Offers $25 Gift Card at Gorjana
Apple Pay Promo Offers $25 Gift Card at Gorjana
5 hours ago
Apple Announces 2026 iPhone App of the Year and More
Apple Announces 2026 iPhone App of the Year and More
5 hours ago
M6 MacBook Pro Cyber Week Deal Takes $250 Off Select Models
M6 MacBook Pro Cyber Week Deal Takes $250 Off Select Models
6 hours ago
Apple Music Launches as a Native App in BMW and Mini Vehicles
Apple Music Launches as a Native App in BMW and Mini Vehicles
6 hours ago
Proton Mail's iPhone App Adds Full-Text Search for Encrypted Email
Proton Mail's iPhone App Adds Full-Text Search for Encrypted Email
7 hours ago
Apple Backs US Warning Over AI Threat to Encryption
Apple Backs US Warning Over AI Threat to Encryption
9 hours ago
Apple's HomeView is Backordered Into February
Apple's HomeView is Backordered Into February
20 hours ago
CARROT Weather Adds Almanac for Personal Weather History
CARROT Weather Adds Almanac for Personal Weather History
21 hours ago
Instagram Cracking Down on Unlabeled Realistic AI Content
Instagram Cracking Down on Unlabeled Realistic AI Content
22 hours ago
Apple Stores Running Short on iPhone Duo Repair Parts
Apple Stores Running Short on iPhone Duo Repair Parts
23 hours ago
AirPods Max 2 or Beats 360? Here's Which Apple Headphones to Get
AirPods Max 2 or Beats 360? Here's Which Apple Headphones to Get
1 day ago
Apple Releases 27.2.2 HomeView Software Update
Apple Releases 27.2.2 HomeView Software Update
1 day ago
Apple's FileMaker Pro Gaining Support for AI Coding Agents
Apple's FileMaker Pro Gaining Support for AI Coding Agents
1 day ago
ChatGPT Brings Redesigned App to iPhone Duo, Expands 'Dots' Access
ChatGPT Brings Redesigned App to iPhone Duo, Expands 'Dots' Access
1 day ago
Missed Black Friday? Amazon's MacBook Air Sale Brings Back Big $399 Discount
Missed Black Friday? Amazon's MacBook Air Sale Brings Back Big $399 Discount
1 day ago
Apple Preparing Online Store for AI Agent Integration
Apple Preparing Online Store for AI Agent Integration
1 day ago
Spotify Wrapped 2026 Now Available
Spotify Wrapped 2026 Now Available
1 day ago
Apple Shares New Video Highlighting Features for Parents With Disabilities
Apple Shares New Video Highlighting Features for Parents With Disabilities
1 day ago
PROLED MacBook Pro Receives Massive $1,000 Amazon Discount [Update: Gone]
PROLED MacBook Pro Receives Massive $1,000 Amazon Discount [Update: Gone]
1 day ago
Apple Escapes $502 Million Payout in UK Optis Patent Dispute
Apple Escapes $502 Million Payout in UK Optis Patent Dispute
1 day ago
iPhone 20 Pro's Redesign May Be Less Radical Than Expected
iPhone 20 Pro's Redesign May Be Less Radical Than Expected
1 day ago
Facebook Messenger Now Works With Apple CarPlay
Facebook Messenger Now Works With Apple CarPlay
1 day ago
Apple's OLED iPad Air Supply Race Heats Up as BOE Starts Production
Apple's OLED iPad Air Supply Race Heats Up as BOE Starts Production
1 day ago
Tim Cook and John Ternus Pay Tribute to Warren Buffett
Tim Cook and John Ternus Pay Tribute to Warren Buffett
1 day ago