Skip to content
fone.tips
iPhone & iPad 8 min read

How to Get Your iCloud Security Code: 3 Working Methods

Quick answer

To get your iCloud security code, go to Settings > your name > Sign-In & Security > Get Verification Code. A 6-digit code appears immediately. If signing in on a new device, the code automatically appears on your trusted devices as a notification.

There are two types of iCloud security codes, and people often confuse them. The verification code is the 6-digit code for signing into your Apple ID on a new device. The Keychain security code is a separate PIN for authorizing iCloud Keychain access. In our testing on iOS 17, getting either code takes under 30 seconds once you know where to look.

  • The iCloud verification code is a 6-digit code generated in Settings > your name > Sign-In & Security > Get Verification Code.
  • Two-factor authentication sends the code automatically to your trusted devices when you sign in on a new device.
  • You can generate a code offline (no internet needed) using the same Settings path — it still works even when Apple’s servers are unreachable.
  • The iCloud Keychain security code is separate from the verification code and is used specifically to authorize Keychain sync on new devices.
  • Forgetting your Keychain security code and choosing “Forgot Code” erases all stored passwords from iCloud Keychain permanently.

#Method 1: Get a Verification Code From Settings

This is the fastest method for getting a code to use on another device or browser.

  1. Open Settings on your iPhone or iPad.
  2. Tap your name at the top.
  3. Tap Sign-In & Security.
  4. Tap Get Verification Code.

A 6-digit code appears immediately. It’s valid for 30 seconds. If you need more time, tap to generate a new one. According to Apple’s support documentation, this method works on any device running iOS 9 or later, iPadOS 13 or later, or macOS 10.11 or later.

In our testing, the code generated via Settings is identical to the one sent automatically to trusted devices during sign-in. Both confirm your identity for the same Apple ID session.

iPhone Settings menu path showing Apple ID Sign-In and Security verification code generation steps

#Method 2: Get a Code on a Trusted Device Automatically

When you sign in to your Apple ID on a new device or browser, Apple sends the 6-digit code automatically to all trusted devices linked to your account.

A notification appears on your trusted iPhone, iPad, or Mac showing “Apple ID Sign-In Requested.” The notification displays the approximate location of the sign-in attempt and a map. Tap Allow to reveal the 6-digit code, then enter it on the new device.

If you don’t see the notification after 60 seconds: check that your trusted device has an internet connection, verify that notifications aren’t blocked for Settings, or use the manual method in Settings instead. Apple’s two-factor authentication system states that trusted devices must be running iOS 9+, iPadOS 13+, or macOS El Capitan+ to receive these automatic codes.

Trusted Apple device receiving automatic verification code popup when signing in from new device

#Can You Get a Verification Code Without Internet?

You can generate a verification code even when your iPhone has no internet connection. In our testing, the offline code worked correctly even with WiFi and cellular both turned off.

  1. Open Settings.
  2. Tap your name.
  3. Tap Sign-In & Security.
  4. You’ll see “Account Details Unavailable” (this is normal offline).
  5. Tap Get Verification Code to generate a local code.

This works via a locally stored cryptographic seed, similar to TOTP apps.

#What Is the iCloud Keychain Security Code?

The iCloud Keychain security code is a separate 4-digit (or custom alphanumeric) PIN that protects your Keychain data when setting up sync on a new device. This is distinct from the 6-digit Apple ID verification code.

To set or reset it, go to Settings > your name > iCloud > Passwords and Keychain.

If you forgot your Keychain security code and tap “Forgot Code” during a new device setup, Apple confirms that choosing this option permanently erases all passwords stored in iCloud Keychain. This can’t be undone. Set up a new Keychain from scratch after this point.

For related Apple ID security issues, see our guides on Apple ID locked and Apple ID verification problems.

#Troubleshooting: Why You Are Not Getting the Verification Code

Several common causes prevent the code from arriving:

Trusted device issue: The code only goes to trusted devices. If you’re on your only device, use the manual Settings method to generate a code you can type manually.

Phone number issue: If your trusted phone number is outdated, update it at appleid.apple.com before you get locked out. According to Apple’s account recovery documentation, accounts with outdated phone numbers may require a multi-day account recovery process.

Blocked notifications: Go to Settings > Notifications > Settings app and verify that both Lock Screen and Banners are enabled. Focus mode, silent mode, or Screen Time restrictions can all suppress the two-factor notification without any indication that it arrived. If you’re using a managed device (school or work MDM profile), the profile may be blocking Apple system notifications from appearing on the lock screen.

Network issue: Automatic code delivery requires a data connection on the trusted device. If your trusted device is offline or in Airplane Mode, use the manual offline method from Settings instead.

Troubleshooting steps for missing iCloud verification code showing signal strength and SMS delivery path

For related issues, see our guides on uploading to iCloud paused and what’s in your iCloud storage.

#Two-Factor Authentication Setup

Two-factor authentication is the foundation for all iCloud verification codes. If you haven’t set it up yet, go to Settings > your name > Sign-In & Security > Two-Factor Authentication and tap “Turn On.”

Once enabled, your Apple ID requires both your password and a verification code for every new sign-in. Apple confirms that 2FA is now mandatory for all new Apple ID accounts created after 2019. Existing accounts can still enable it manually, and Apple strongly encourages this for accounts with iCloud data.

#Bottom Line

For most situations, use Settings > your name > Sign-In & Security > Get Verification Code on any trusted device. The code appears immediately and works both online and offline. If you’re setting up a new device and need the Keychain code, that’s a separate 4-digit PIN stored only on your account — not something Apple can recover. If you’ve lost it and reset it, all Keychain passwords are erased. See our guide on unlock activation lock if you’re facing broader iCloud access issues.

#Frequently Asked Questions

Where is the iCloud security code in Settings?

Go to Settings > your name > Sign-In & Security > Get Verification Code. This generates your 6-digit Apple ID verification code immediately without needing to wait for a text message or notification. The same path works whether you’re online or offline.

What’s the difference between the 4-digit and 6-digit iCloud codes?

Different codes, different purposes. The 6-digit code authenticates your Apple ID sign-in on new devices. The 4-digit code authorizes iCloud Keychain sync. You can have one without the other.

Can you get an iCloud verification code without a trusted device?

Yes, via SMS to your trusted phone number. If you don’t have a trusted device available, enter your Apple ID and password, then choose “Didn’t get a verification code” and select your trusted phone number for an SMS code. The number must be currently active and receiving SMS.

How long is an iCloud verification code valid?

About 30 seconds. Generate a new one from Settings > Sign-In & Security > Get Verification Code when needed.

What happens if you enter the wrong iCloud security code too many times?

Apple temporarily locks verification code entry after repeated failures. Wait a few minutes and try again. If locked out completely, contact Apple Support for account recovery. The wait duration increases with each successive failed attempt, following an exponential backoff pattern similar to most authentication systems.

Is the iCloud security code the same as the device passcode?

No. They’re completely separate. Your iPhone passcode is local device access. The iCloud verification code is for Apple ID authentication. The Keychain PIN is for password sync. Three different codes, none related to each other.

Can Apple Support recover a forgotten Keychain security code?

No. Apple’s design intentionally prevents recovery of the Keychain security code. If you’ve forgotten it and trigger a reset, all passwords stored in iCloud Keychain are permanently erased. Apple Support can’t retrieve the passwords. This is by design to protect your privacy. For iCloud account access issues unrelated to Keychain, see apple-id-locked.

Fone.tips Editorial Team

Our team of mobile tech writers has been helping readers solve phone problems, discover useful apps, and make informed buying decisions since 2018. About our editorial team

Share this article

Beyond iPhone & iPad

Explore Apps