Generate 2FA Code

Instantly convert a standard Base32 secret key into a valid 6-digit TOTP (Time-Based One-Time Password), including its real-time expiration metrics.

2FA Utilities

Pass the alphanumeric secret key provided by your account provider (e.g., Authenticator App setup key). Our system parses the strict Base32 formats and calculates the exact active code required for your current timestamp.

Payload Parameters

Paste the secret key without worrying about spaces or hyphens. The system automatically cleanses the input.

Response Breakdown

code: The precise 6-digit numeric string you need to enter.
timeRemaining: Countdown (in seconds) until the code expires, allowing you to build dynamic visual indicators to avoid usage on expirations.

POST
https://api.hsmail.shop/v1/tools/2fa/generate
Headers:Authorization: (Not Set - Set in Topbar)

Implementation Snippets

curl -X POST https://api.hsmail.shop/v1/tools/2fa/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"secret":"JBSWY3DPEHPK3PXP"}'