Get Apple Two-Factor Codes on Mac Manually
In this article
- Why Apple Uses Two-Factor Authentication
- How the Codes Normally Appear on a Mac
- When You Might Need to Get the Code Manually
- Step-by-Step: Get the Code on macOS Ventura or Later
- Step-by-Step: Get the Code on macOS Monterey or Earlier
- What If the Mac Isn't Signed In or You Don't Have a Trusted Device?
- Common Problems and How to Fix Them
- Security and Privacy Considerations
- Frequently Asked Questions
Yes, you can manually get Apple two-factor authentication codes on a Mac by opening System Settings (or System Preferences on older macOS), clicking your Apple ID name at the top, selecting Password & Security, and then clicking Get Verification Code. This works even when your trusted devices are unavailable, as long as you're signed in to your Apple ID on that Mac and know your Mac's password.
Why Apple Uses Two-Factor Authentication
Apple introduced two-factor authentication (2FA) as an extra layer of security for your Apple ID. When you sign in to a new device or access your account from an unfamiliar browser, Apple requires both your password and a six-digit verification code. This prevents someone who only knows your password from gaining access. The code is generated on your trusted devices—iPhones, iPads, Macs—or sent to your trusted phone number via SMS or automated call. Since 2015, Apple has pushed this system for all new accounts, and it now applies to most existing accounts as well.
How the Codes Normally Appear on a Mac
On a Mac that's already signed in to your Apple ID, the verification code usually appears automatically in a notification when you attempt to sign in elsewhere. For example, if you try to log in to iCloud.com from a Windows PC, your Mac will pop up a notification with the six-digit code. You can also find the code without waiting for a notification:
- Open System Settings (macOS Ventura or later) or System Preferences (macOS Monterey or earlier).
- Click your name at the top of the sidebar (or the Apple ID icon in older versions).
- Select Password & Security.
- Click Get Verification Code next to the Apple ID label.
The code appears on screen, and you can type it into the device or browser asking for it. It refreshes every 30 seconds, so you have a short window to use it.
When You Might Need to Get the Code Manually
There are several situations where the automatic notification doesn't appear or you simply need to retrieve the code manually:
- The Mac is your only trusted device, and you're signing in on a non-Apple device.
- Notifications are disabled for Apple ID sign-in prompts.
- You're using a web browser on the Mac itself and need a code for a different service that uses your Apple ID (like Game Center or Find My).
- Your iPhone is off, lost, or out of battery, and the Mac is the only available trusted device.
In all these cases, the manual method works exactly the same as the automatic one—it just requires a few extra clicks.
Step-by-Step: Get the Code on macOS Ventura or Later
If your Mac is running macOS Ventura (released 2022) or a newer version, follow these steps:
- Click the Apple menu (top-left corner) and choose System Settings.
- Click your name at the top of the sidebar.
- Click Password & Security in the right pane.
- Next to Apple ID, click the Get Verification Code button.
- A six-digit code appears in a dialog box. Note that it refreshes every 30 seconds, so type it promptly.
If you don't see the button, make sure you're signed in to iCloud with the same Apple ID that's requesting the code. You may also need to enter your Mac's login password before the code is displayed.
Step-by-Step: Get the Code on macOS Monterey or Earlier
For older macOS versions (Big Sur, Catalina, Mojave, etc.), the steps are slightly different:
- Open System Preferences from the Apple menu.
- Click Apple ID (if you see it) or your name at the top.
- Select Password & Security from the sidebar.
- Click Get Verification Code.
In some older versions, you might need to click the iCloud icon first, then click Account Details and choose Security. The exact wording may vary slightly, but the button is always labeled "Get Verification Code" or "Get Code."
What If the Mac Isn't Signed In or You Don't Have a Trusted Device?
If the Mac isn't signed in to your Apple ID, you can't get a code from it. In that case, you can use other trusted methods:
- Use your iPhone or iPad: Go to Settings Password & Security > Get Verification Code .
- Use the phone number associated with your Apple ID: Apple can send a code via SMS or automated phone call to your trusted number. You'll see the option to "Didn't get a code?" on the sign-in screen.
- Use an app-specific password if you're trying to sign in to a third-party app (like an email client) and 2FA is blocking you.
If you have no trusted devices and no access to your trusted phone number, you may need to go through Apple's account recovery process, which can take several days. This is why it's important to keep your trusted devices and phone number up to date in your Apple ID settings.
Common Problems and How to Fix Them
Sometimes the manual code retrieval doesn't work as expected. Here are common issues and solutions:
- No "Get Verification Code" button: Make sure you're signed in to iCloud on that Mac. If you're signed in but the button is grayed out, restart the Mac and try again.
- Code doesn't work: Codes expire after 30 seconds. If you type it too slowly, wait for the next one and try again.
- Mac says "Account Not Eligible": This usually means your Apple ID isn't set up for two-factor authentication, or you're using an older form of two-step verification. Check your Apple ID settings on the web to confirm which security method is active.
- You're prompted for a Mac password you forgot: You'll need to reset your Mac login password, which may require recovery mode or another administrator account.
Security and Privacy Considerations
Manually getting a verification code on your Mac is safe, but keep these points in mind:
- Never share the code with anyone. Apple will never ask for it via phone, email, or text.
- If you're in a public place, be aware of shoulder-surfers when entering the code.
- If you suspect your Apple ID is compromised, change your password immediately and consider signing out of all devices.
- Keep your Mac's operating system updated to ensure you have the latest security patches.
Two-factor authentication is one of the best ways to protect your account, and knowing how to manually retrieve a code gives you a reliable fallback when automatic prompts fail.
Frequently Asked Questions
Can I get the verification code from my Mac without an internet connection?
No. The code generation requires a secure connection to Apple's servers, so you need an active internet connection on the Mac. If you're offline, you won't be able to retrieve a code.
Does the manual code work for signing into iCloud.com on a Windows PC?
Yes. The code you get from your Mac is a standard six-digit verification code that works for any sign-in prompt that asks for your Apple ID verification code, including iCloud.com on a Windows PC.
Why does my Mac show a code but the sign-in says it's invalid?
This usually happens because the code expired before you entered it. Codes change every 30 seconds. Wait for the next code and try again, making sure to type it within the time window.
Can I use the same code on multiple devices at once?
Yes, the code is tied to your Apple ID, not to a specific device. You can use the same code on multiple sign-in attempts within the 30-second window, but it's safer to use a fresh code for each sign-in if possible.
What if I don't see the "Get Verification Code" button on my Mac?
Make sure you're signed in to iCloud with the Apple ID you need the code for. If you're signed in but the button is missing, try signing out and back in, or restart your Mac. If the issue persists, check Apple's system status page for any outages.