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

iOS 18 Siri Personal Context

Siri AI Settlement Website Now Live: Apple to Pay Some iPhone Owners

Sunday September 20, 2026 7:24 pm PDT by
In May, Apple agreed to pay $250 million to settle a U.S. class action lawsuit over Siri AI's delayed launch, and the settlement website is now live. Apple will pay an estimated $25 per eligible iPhone to eligible customers, who can submit a claim via the settlement website between September 21 and December 21 of this year. The exact payment may be higher or lower than $25 depending on the...
iOS 26 Home Feature

Apple Will Soon Announce an All-New Operating System

Tuesday September 22, 2026 9:19 am PDT by
Apple is developing an all-new operating system that is essentially a mix of tvOS, watchOS, and iOS, according to Bloomberg's Mark Gurman. In his latest Power On newsletter, Gurman reiterated that the operating system will feature a grid of app icons, widgets, and customizable clock faces. The new software platform is intended for Apple's long-rumored smart home hub. With built-in facial...
Mostly Screen iPhone Purple Feature 2027

iPhone 20 Pro Display Sizes Leak Ahead of 2027 Launch

Monday September 21, 2026 4:29 am PDT by
Apple's 20th-anniversary iPhone lineup could feature slightly larger displays than the iPhone 18 Pro models, if a new leak shared on Weibo is accurate. Prolific Chinese leaker Digital Chat Station claims that early iPhone 20 Pro display specifications include a 6.41-inch screen with a resolution of approximately 2,686 × 1,236 pixels, while the iPhone 20 Pro Max is said to have a 6.96-inch...
Latest Stories
iPhone Handoff in iOS 27: How It Works, Pricing, and Carrier Support
iPhone Handoff in iOS 27: How It Works, Pricing, and Carrier Support
40 minutes ago
ChatGPT in Siri 'Persistently Underperforming,' Says OpenAI
ChatGPT in Siri 'Persistently Underperforming,' Says OpenAI
7 hours ago
You Can Now Try Apple's Unreleased Copland OS in Your Browser
You Can Now Try Apple's Unreleased Copland OS in Your Browser
10 hours ago
iOS 27.0.1 is Coming Soon
iOS 27.0.1 is Coming Soon
11 hours ago
Apple Releases watchOS 27.0.1 With Fix for Restart Bug
Apple Releases watchOS 27.0.1 With Fix for Restart Bug
11 hours ago
Disney+ and Hulu Raise Prices Again, Ad-Free Plans Now $21.49
Disney+ and Hulu Raise Prices Again, Ad-Free Plans Now $21.49
12 hours ago
Apple Sports App Updated With Even More Soccer Leagues
Apple Sports App Updated With Even More Soccer Leagues
12 hours ago
AirTag 2 4-Pack Hits $79.99 on Amazon, Matching Record Low
AirTag 2 4-Pack Hits $79.99 on Amazon, Matching Record Low
14 hours ago
Siri AI Coming to HomePod
Siri AI Coming to HomePod
14 hours ago
iPhone Air vs. iPhone 18 Pro Buyer's Guide: Which Should You Buy?
iPhone Air vs. iPhone 18 Pro Buyer's Guide: Which Should You Buy?
15 hours ago
Apple Podcasts Subscriptions Will Soon Support Video
Apple Podcasts Subscriptions Will Soon Support Video
17 hours ago
Apple Watch Ultra 3 Drops to Record Low $599.97 on Amazon [Updated]
Apple Watch Ultra 3 Drops to Record Low $599.97 on Amazon [Updated]
17 hours ago
AT&T Responds to iOS 27's New iPhone Handoff Feature
AT&T Responds to iOS 27's New iPhone Handoff Feature
17 hours ago
Launch Discounts Arrive for New Mac Mini and Mac Studio, Plus Massive Deal on Samsung's Portable SSD
Launch Discounts Arrive for New Mac Mini and Mac Studio, Plus Massive Deal on Samsung's Portable SSD
17 hours ago
New iPhone Setting Lets Users Shake Off Motion-Sensing Ads
New iPhone Setting Lets Users Shake Off Motion-Sensing Ads
19 hours ago
Apple Intelligence Taking Up 30GB+ on Some Macs Running macOS 27
Apple Intelligence Taking Up 30GB+ on Some Macs Running macOS 27
21 hours ago
New Mac Mini Has Two Storage Downsides, Including Unremovable SSD
New Mac Mini Has Two Storage Downsides, Including Unremovable SSD
1 day ago
Apple Card Savings Account's Interest Rate Just Went Up
Apple Card Savings Account's Interest Rate Just Went Up
1 day ago
Apple Releases First Public Betas of iOS 27.2 and macOS Golden Gate 27.2
Apple Releases First Public Betas of iOS 27.2 and macOS Golden Gate 27.2
1 day ago
OpenAI's New GPT-6 Sol and Luna Models Bring Astra Improvements to Cheaper Tiers
OpenAI's New GPT-6 Sol and Luna Models Bring Astra Improvements to Cheaper Tiers
1 day ago
Apple Park Visitor Center Just Lost an Attraction Offered Since 2017
Apple Park Visitor Center Just Lost an Attraction Offered Since 2017
1 day ago
Shazam App for iPhone Updated With New Icon and iMessage Stickers
Shazam App for iPhone Updated With New Icon and iMessage Stickers
1 day ago
Anthropic Launches Claude Opus 5.5 With Fable-Level Performance at a Lower Price
Anthropic Launches Claude Opus 5.5 With Fable-Level Performance at a Lower Price
2 days ago
Apple Releases Firmware Update for Beats 360
Apple Releases Firmware Update for Beats 360
2 days ago
Beats 360 Pre-Orders Open at Amazon With Cushion Kits on Sale, Plus More Beats Deals
Beats 360 Pre-Orders Open at Amazon With Cushion Kits on Sale, Plus More Beats Deals
2 days ago
Apple Puts AirTag-Sized AI Pin on Hold
Apple Puts AirTag-Sized AI Pin on Hold
2 days ago
Beats 360 Ear Cushion Kits Just $9.99 Each Until the End of October
Beats 360 Ear Cushion Kits Just $9.99 Each Until the End of October
2 days ago
Apple Testing Prototypes of Whoop-Like Screenless Fitness Band
Apple Testing Prototypes of Whoop-Like Screenless Fitness Band
2 days ago
Apple Will Soon Announce an All-New Operating System
Apple Will Soon Announce an All-New Operating System
2 days ago
Apple Watch Series 10 vs. Series 12 Buyer's Guide: Should You Upgrade?
Apple Watch Series 10 vs. Series 12 Buyer's Guide: Should You Upgrade?
2 days ago