How to Safely Store 2FA Recovery Codes
Emergency backup codes are the master keys to your two-factor authentication. Learn how to store them without plaintext risks.
Last updated: November 15, 2026
Author: Perry Lei
Reviewed: November 15, 2026 by TOTPBOX Security Review
Never take a screenshot or paste recovery codes into unencrypted cloud note-taking apps. If an attacker gains read access to your cloud notes, your entire two-factor defense is bypassed.
1. What are recovery codes?
When you configure TOTP or Passkeys on services like GitHub, Google, or AWS, you receive a set of 8 to 16 alphanumeric strings known as backup or recovery codes. Each code can be used exactly once to bypass the standard second factor in the event that your authenticator device is lost, stolen, or damaged.
2. Common storage antipatterns
Because recovery codes are presented as text or downloadable .txt files, users frequently store them in ways that compromise security:
- Saving unencrypted recovery.txt files in the Downloads folder
- Taking desktop screenshots and leaving them on cloud-synced desktops
- Pasting codes into unencrypted note-taking apps or emails sent to self
- Storing recovery codes in the exact same password manager vault as master passwords
3. Recommended storage hierarchy
Tier 1: Local-first encrypted vault
Use TOTPBOX's integrated Recovery Code Vault. Codes are encrypted with AES-256-GCM locally on your device and linked directly to the associated TOTP account, keeping second-factor recovery isolated from general password databases.
Tier 2: Physical offline backup
For root identity accounts (primary email, domain registrar, and master cloud console), print a physical copy on paper and store it inside a secure, fireproof lockbox. Physical paper cannot be exfiltrated via remote malware or API breaches.
4. Lifecycle management
Recovery codes expire as they are consumed. Follow these lifecycle rules:
- Strike out redeemed codes immediately so you know which remain valid
- When down to two remaining codes, regenerate a fresh set in the service settings
- Audit recovery codes annually during your routine security checkup