Skip to content
OTP Generator

Microsoft 2FA code generator

Paste your Microsoft two-factor secret key to get the current 6-digit login code, the same one your authenticator app shows.

Find it under “Can’t scan the QR code?” when you turn on 2FA. Only have the QR?

2Your code will appear here
Paste a key to start
Calculated in your browser. Your key is never sent anywhere.
On this page

Microsoft pushes its own Authenticator app, but personal Microsoft accounts and most work accounts also accept any standard TOTP app. During setup there is a link to use a different authenticator app, and from there you can reveal a secret key. Paste it above to generate the 6-digit code that Outlook.com, OneDrive, Xbox and Windows sign-in will accept.

This is useful when you prefer not to install another app or need a code while your phone is charging in another room. The key is processed only in your browser tab. Microsoft accounts are often tied to purchases, Xbox profiles and Windows licences, so keep the key backed up and save your recovery code as well.

How to find your Microsoft secret key

  1. Sign in at account.microsoft.com and open Security. Look for Manage how I sign in (older layouts call it Advanced security options).
  2. Choose Add a new way to sign in or verify, then select Use an app.
  3. When Microsoft suggests its own Authenticator, pick the link to set up a different authenticator app instead.
  4. Select I can't scan the bar code to reveal the secret key. Work or school accounts follow a similar path at mysignins.microsoft.com under Security info.
  5. Copy the key and keep it somewhere private before continuing.

How to log in to Microsoft with the code

  1. Paste the Microsoft key into the generator at the top of this page.
  2. Copy the current 6-digit code.
  3. Enter it on the Microsoft setup screen to verify the app. For later sign-ins, choose the option to use a verification code from an app and enter a freshly generated one.

Microsoft 2FA tips

  • Microsoft offers a recovery code in your security settings. Generate it, save it offline and replace it after you use it, because it is the fastest way back in if every other method fails.
  • Some older apps and devices, such as certain mail clients or consoles, cannot show a 2FA prompt. Microsoft lets you create app passwords for them once two-step verification is on.
  • If your organization manages your account, the IT admin may require the Microsoft Authenticator app specifically. In that case a generic TOTP key might not be offered, which is a policy choice rather than a bug.

Your Microsoft key is processed only in this browser and is never uploaded. Keep a copy in an authenticator app or password manager as well.

Microsoft 2FA FAQ

Do I need the Microsoft Authenticator app?

Not for most personal accounts. Microsoft accepts codes from any standard authenticator once you choose the different authenticator app option during setup. Microsoft Authenticator adds push approvals and passwordless sign-in, but this generator covers the 6-digit code method.

Will this work for Outlook and Hotmail addresses?

Yes. Outlook.com, Hotmail and Live addresses are Microsoft accounts, so they share the same two-step verification settings. The key you set up at account.microsoft.com protects your mailbox, OneDrive, Xbox and other Microsoft services together.

Why is my Microsoft code rejected?

Check three things: that your computer clock is set automatically, that you are using the most recent key (adding a new app can replace older ones), and that you typed the code before the 30-second window ended. Try the next code if you were close to the cutoff.

What happens if I lose access to every sign-in method?

Use your saved recovery code first. Without it, Microsoft's account recovery form asks questions to confirm ownership, and for accounts with two-step verification it can take time or fail. That is why storing the key and recovery code safely matters.

Get your Microsoft code

Paste the Microsoft setup key and copy the current 6-digit code in seconds.