Get a verification code and sign in with two-factor authentication

With two-factor authentication, you'll need a verification code to sign in with your Apple ID on a new device or browser.

Whenever you sign in with your Apple ID on a new device or browser, you'll need to confirm your identity with your password plus a six-digit verification code. There are a few ways you can get a verification code. You can use the code displayed on your trusted device, receive a text message or phone call, or generate a code from your trusted device.

If you're using iOS 11.3 or later on your iPhone, you may not need to enter a verification code. In some cases, your trusted phone number can be automatically verified in the background on your iPhone. It's one less thing to do, and your account will still be protected with two-factor authentication.


Use the code displayed on your trusted device

If you have a trusted device running iOS 9 and later, OS X El Capitan and later, iPadOS 13 and later, or watchOS 6 and later, the verification code will be displayed automatically on your trusted devices.

  1. Sign in with your Apple ID and password on a new device or browser.
  2. Look for a sign-in notification on any of your trusted devices.
    Map with Buffalo, NY prominently marked on it. The caption indicates that an Apple ID is being used to sign in to an iPhone near Buffalo.
  3. Tap Allow to receive your verification code.
  4. Enter the verification code on your other device to complete the sign-in process.

Receive a text message or phone call

If you don't have a trusted device to hand, you can get a verification code sent to your trusted phone number as a text message or phone call.

  1. Click "Didn't get a verification code" on the sign-in screen.
  2. Choose to get the code sent to your trusted phone number.
  3. You'll receive a text message or phone call from Apple with your verification code. This text message might include an additional domain validation line. This line includes the @ symbol, the website name and your code (for example: @icloud.com #123456 %apple.com).
    Receive a text message with your verification code and a domain validation line
  4. Enter the code on your other device to complete the sign-in process.

Get a code from Settings on your trusted device

If you can't receive a verification code on your trusted devices automatically, you can get one from Settings, even if your device is offline.

From your iPhone, iPad or iPod touch

If your device is online:

  1. Go to Settings > [your name].
  2. Tap Password & Security > Get Verification Code.
    iPhone screen showing how to get a verification code from Settings.

If your device is offline:

  1. Go to Settings > [your name].
  2. Tap Password & Security. 
  3. A message states "Account Details Unavailable". Tap Get Verification Code.

From your Mac

  1. Go to Apple menu  > System Preferences, then click Apple ID.
  2. Click Password & Security > Get Verification Code.
    How to get a verification code on a Mac from System Preferences.

If you still can't sign in

If you can't sign in, reset your password or get verification codes, you can request account recovery to regain access to your account. Account recovery may take a few days or longer, depending on the specific account information you can provide to verify your identity.

Published Date: