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 16 Battery Life Feature

iOS 26's New Battery Life Mode Available Only on These iPhone Models

Saturday June 21, 2025 9:02 am PDT by
Last week, we reported that iOS 26 introduces an opt-in Adaptive Power Mode on the iPhone, alongside the existing Low Power Mode. Apple says that Adaptive Power Mode can make "small performance adjustments" when necessary to extend an iPhone's battery life, including slightly lowering the display brightness or allowing some activities to "take a little longer." The full description of...
iPhone 17 Pro Blue Feature Tighter Crop

iPhone 17 Pro Launching in Three Months With These 12 New Features

Saturday June 21, 2025 2:45 pm PDT by
The iPhone 17 Pro and iPhone 17 Pro Max are around three months away, and there are plenty of rumors about the devices from credible sources. Below, we recap key changes rumored for the iPhone 17 Pro models as of June 2025:Aluminum frame: iPhone 17 Pro models are rumored to have an aluminum frame, whereas the iPhone 15 Pro and iPhone 16 Pro models have a titanium frame, and the iPhone X...
apple wallet drivers license feature iPhone 15 pro

iPhone Driver's Licenses: These 17 U.S. States Offer Them or Will Later

Thursday June 19, 2025 11:28 am PDT by
In select U.S. states, residents can add their driver's license or state ID to the Wallet app on the iPhone and Apple Watch, providing a convenient and contactless way to display proof of identity or age at select airports and businesses, and in select apps. Unfortunately, this feature continues to roll out very slowly since it was announced in 2021, with only nine U.S. states and Puerto...
All Screen iPhone 2027 Feature 1

iPhone Reportedly Moving to All-Screen Design in Two Stages

Sunday June 22, 2025 3:58 pm PDT by
Apple has long been working towards an iPhone with an all-screen design, and it might finally achieve the feat in a few more years from now. In his Power On newsletter today, Bloomberg's Mark Gurman said that Apple will shrink the size of the Dynamic Island on new iPhone models released next year. A year after that, he expects Apple to release a redesigned 20th-anniversary iPhone model....
ios 26 call holding

iOS 26 Beta is Hiding a New Ringtone — Here's What It Sounds Like

Thursday June 19, 2025 7:25 pm PDT by
Apple is hiding a new ringtone within iOS 26. The new ringtone is an alternative version of the existing Reflection ringtone, which has been the default ringtone since the iPhone X was released in 2017. It was discovered within the code for the first developer beta of iOS 26, but it remains hidden, so you will not find it in the list of ringtones available in the Settings app for now. It...
iPhone 17 Pro Blue Feature Tighter Crop

iPhone 17 Pro Launching in Three Months With These 12 New Features

Saturday June 14, 2025 5:45 pm PDT by
The iPhone 17 Pro and iPhone 17 Pro Max are three months away, and there are plenty of rumors about the devices. Below, we recap key changes rumored for the iPhone 17 Pro models as of June 2025:Aluminum frame: iPhone 17 Pro models are rumored to have an aluminum frame, whereas the iPhone 15 Pro and iPhone 16 Pro models have a titanium frame, and the iPhone X through iPhone 14 Pro have a...
iPhone 17 Pro Blue Feature Tighter Crop

iPhone 17 Pro's Alleged Vapor Chamber Cooling System Partly Revealed

Sunday June 22, 2025 6:37 am PDT by
Apple's upcoming iPhone 17 Pro and iPhone 17 Pro Max models are rumored to be equipped with a vapor chamber cooling system, and a leaker known as Majin Bu today shared a photo of an alleged copper thermal plate for the system. Many high-end Android smartphones like Samsung's Galaxy S25 Ultra are equipped with a vapor chamber cooling system, which can manage heat dissipation inside the...
Wi Fi WiFi General Feature

iOS 26 Adding Two New Wi-Fi Features, Allows AirDrop and AirPlay Alternatives

Saturday June 21, 2025 7:02 am PDT by
iOS 26 is gaining two new Wi-Fi features, including Captive Assist and Wi-Fi Aware. MacRumors contributor Aaron Perris discovered a reference to Captive Assist within the code for the first iOS 26 developer beta, but Apple has yet to enable the feature. It should be available by the time the software update is released later this year. In his Power On newsletter last month, Bloomberg's...
apple watch ultra 2 new black

Apple Watch Ultra 3 Finally Coming After Two-Year Hiatus

Monday June 16, 2025 8:45 am PDT by
Apple will finally deliver the Apple Watch Ultra 3 sometime this year, according to analyst Jeff Pu of GF Securities Hong Kong (via @jukanlosreve). The analyst expects both the Apple Watch Series 11 and Apple Watch Ultra 3 to arrive this year (likely alongside the new iPhone 17 lineup, if previous launches are anything to go by), according to his latest product roadmap shared with...