How to Get or Generate a Verification Code for Apple Two-Factor Authentication

Aseem Kishore
·
8 min read

Online Tech Tips is reader-supported. We may earn a commission when you buy through links on our site. Learn more.

Been struggling to sign into your Apple Account on a new device because you’re not getting a verification code? You’re not alone. This trips up a lot of people. Apple’s two-factor authentication (2FA) is great for keeping your account secure, but when the automatic code popup doesn’t show up, it can feel like you’re locked out with no way in.

The good news: you can manually generate a verification code yourself, right from your iPhone, iPad, or Mac, even if the device has no internet connection. In this guide, you’ll learn exactly how to get your Apple verification code, what to do if you never receive one automatically, and how to handle the trickier situations where you can’t access any of your trusted devices.

What Is Apple Two-Factor Authentication?

Two-factor authentication (2FA) is a security feature that requires you to prove who you are in two ways when signing into your Apple Account on a new device: your password plus a six-digit verification code. Think of it like a deadbolt on top of a regular door lock. Even if someone gets your password, they still can’t get in without that code.

A quick note on terminology: Apple now officially calls this your Apple Account (you might still see “Apple ID” in some places, but it’s the same thing). The old “two-step verification” system has been replaced by the newer, more secure two-factor authentication, and most accounts have it enabled by default these days.

How Verification Codes Work

When you sign into your Apple Account on a new device or browser, Apple sends a six-digit code to your trusted devices (iPhones, iPads, or Macs already signed in with your Apple Account) or to a trusted phone number via SMS or phone call. You enter that code on the new device, and you’re in.

Most of the time this happens automatically. A notification pops up on your iPhone, you tap Allow, and the code appears. But sometimes the popup never shows, or you need a code right now without waiting. That’s where manually generating one comes in handy.

How to Get a Verification Code Automatically (The Normal Flow)

Before jumping to the manual method, here’s how the automatic flow is supposed to work, just so you know what to expect:

  1. On the new device or browser, sign in with your Apple Account email and password.
  1. A sign-in notification appears on your trusted devices (any iPhone, iPad, or Mac already signed in).
  1. On a trusted device, tap or click Allow.
  1. A six-digit verification code appears on that device.
  1. Enter the code on the new device to finish signing in.

If the location shown in the prompt looks a little off but you know it’s you signing in, you can still tap Allow. Apple’s location detection isn’t always pinpoint accurate.

How to Manually Generate a Verification Code

Didn’t get an automatic prompt? No problem. You can generate a fresh verification code directly from Settings on any trusted device. This works even if the device is offline, which is a genuinely useful trick to know.

On iPhone or iPad

  1. Open the Settings app.
  1. Tap your name at the very top of the screen.
  1. Tap Password & Security.
  1. Tap Get Verification Code.

A six-digit code will appear immediately. Type it into whatever device or browser you’re trying to sign into.

No internet connection? No worries. Follow the same steps. You’ll see a message that says something like “Account Details Unavailable,” but you can still tap Get Verification Code and it’ll generate one locally.

iPhone Settings app showing the user's name at the top, with Password & Security option visible after tapping the name, and Get Verification Code button at the bottom of the Password & Security screen

On Mac

  1. Click the Apple menu () in the top-left corner of your screen.
  1. Select System Settings.
  1. Click your name (or Apple Account) at the top of the sidebar.
  1. Click Password & Security.
  1. Click Get Verification Code.
macOS System Settings showing the Apple Account section with Password & Security selected and the Get Verification Code button visible

How to Get a Code via Text Message or Phone Call

If you don’t have access to a trusted device at all, maybe it’s broken, lost, or just not nearby, you can get a verification code sent to your trusted phone number instead.

  1. On the sign-in screen where it’s asking for the verification code, tap or click Didn’t Get a Code? or Can’t get to your devices?
  1. Choose Text message or Phone call for your trusted phone number.
  1. Apple sends a six-digit code via SMS or reads it to you over a call.
  1. Enter the code to complete your sign-in.

One thing to watch out for: if you have Unknown Senders filtering turned on in the Messages app, Apple’s SMS code might get buried in there. Check that folder if you’re not seeing it in your main inbox. Also make sure Do Not Disturb or a Focus mode isn’t hiding the notification.

Apple sign-in screen showing the "Didn't Get a Code?" option with choices for text message or phone call to a trusted number

What to Do If You Can’t Access Any Trusted Device or Phone Number

This is the worst-case scenario. You’ve lost access to all your trusted devices and your trusted phone number is outdated or gone. It happens, and Apple does have a path forward, though it takes a bit longer.

  1. Try to sign into your Apple Account as normal.
  1. On the verification code screen, tap or click Didn’t Get a Code? or Can’t get to your devices?
  1. Select Can’t use [your phone number].
  1. Follow the on-screen instructions to start Apple’s account recovery process.

The account recovery process can take a few days. Apple does this deliberately to prevent unauthorized people from hijacking accounts. If you’ve set up an Account Recovery Contact (a trusted friend or family member you’ve designated in Settings), they can help speed things up significantly.

Tips and Troubleshooting

Common Issues

Problem: I’m not receiving the verification code on my phone

First, remember that the code goes to your trusted devices as a notification, not necessarily as a regular text message. Check your iPhone, iPad, or Mac for a sign-in notification before assuming something’s broken. If you specifically want it via SMS, tap Didn’t Get a Code? and choose your phone number explicitly.

Problem: The code I entered isn’t working

Verification codes expire quickly. If you waited too long to enter it, it’s already no good, so just generate a new one using the steps above. Also make sure you’re not accidentally entering your device passcode or an old code from a previous attempt.

Problem: My trusted phone number is old and I no longer have that number

If you can still sign in, update your trusted phone numbers here:

  • On iPhone/iPad: Go to Settings → tap your name → Password & Security → Trusted Phone Number → Edit
  • On Mac: Go to Apple menu → System Settings → your name → Password & Security
  • On the web: Sign in at appleid.apple.com, go to security settings, and use the + and – buttons to add and remove numbers

Problem: I’m not seeing the code prompt on any of my trusted devices

Skip waiting for the prompt and generate the code manually instead. Head to Settings → your name → Password & Security → Get Verification Code on any trusted iPhone, iPad, or Mac. Make sure the device’s date, time, and region settings are correct too, since mismatched settings can occasionally cause issues.

Problem: Can I turn off two-factor authentication?

If your Apple Account was created with 2FA already enabled, you can’t turn it off. It’s permanent. If you just turned it on, Apple gives you roughly two weeks to change your mind via a link in your account settings. After that window, it’s locked in for good.

Pro Tips

  • Add a backup trusted phone number: Go to Settings → your name → Password & Security and add a second number (like a spouse’s phone or a work number). This is the single best thing you can do to avoid ever getting locked out.
  • Set up an Account Recovery Contact: In Settings → your name → Password & Security → Account Recovery, you can designate a trusted person who can help you regain access if you lose everything.
  • Use a voice call if SMS keeps failing: When you tap Didn’t Get a Code?, choose the phone call option instead of text. Some carriers are flaky with short-code SMS messages, but a voice call almost always gets through.
  • Offline code generation works: You can generate a verification code on a trusted iPhone or iPad even with no Wi-Fi or cellular signal. Handy if you’re traveling and have limited connectivity.

Wrapping Up

Not getting an automatic verification code doesn’t mean you’re stuck. You can generate one yourself in just a few taps on any trusted iPhone, iPad, or Mac. And if you don’t have a trusted device handy, a quick SMS or phone call to your trusted number will get you sorted. The key takeaway: don’t wait around for a popup that might never come. Just go generate the code yourself.

Honestly, the best thing you can do right now is add a second trusted phone number and set up an Account Recovery Contact before you ever need them. Future you will be very grateful. If you’re still having trouble getting in, Apple’s official two-factor authentication support page is worth a read, or reach out to Apple Support directly.