Skip to main content
totp2faauthenticatorsecuritydeveloper-toolswebdevtoolbox

How to Use the TOTP / 2FA Code Generator — WebdevToolbox Guide

Enter a Base32 secret to see the current and next TOTP code, refreshed live.

WebdevToolbox Team3 min read

Testing a 2FA integration usually means reaching for your phone every 30 seconds to type in a code. If you already have the Base32 secret (the same one embedded in the QR code you’d normally scan), this tool generates the same codes right in your browser.

What Is the TOTP / 2FA Code Generator?

TOTP / 2FA Code Generator is one of the tools in WebdevToolbox’s Security & Crypto category. Enter a Base32 secret key and see the current 6-digit (or 8-digit) code plus the next one, refreshed every second using the standard RFC 6238 TOTP algorithm.

How to Use It

  1. Open the tool at /tools/totp-generator.
  2. Paste the Base32 secret from your 2FA setup (the string shown as an alternative to scanning the QR code).
  3. Adjust digits, period, or algorithm only if your service uses a non-default configuration.
  4. Read the current code, watch the countdown, and copy it when you need it.

Key Features

  • RFC 6238 TOTP over Web Crypto — uses the browser’s native HMAC-SHA1/SHA-256 implementation, the same algorithm authenticator apps use.
  • Live countdown — a progress bar and seconds-remaining label show exactly when the code will roll over.
  • Current + next code — see the upcoming code in advance so you’re never caught mid-rollover.
  • Configurable digits/period/algorithm — covers the less common TOTP setups some services use.
  • 100% local — your secret is used only in-memory; nothing is sent anywhere.

When to Use the TOTP / 2FA Code Generator

  • Testing 2FA flows — generate codes without unlocking your phone during development.
  • Automated test setups — manually verify a code before wiring TOTP generation into a test script.
  • Debugging clock-skew issues — compare the code your server expects against what this tool computes for the same secret.

Try It Now

Open TOTP / 2FA Code Generator directly from anywhere on the site using ⌘K and typing the tool name. No login required — everything runs offline-capable in your browser.


Part of the Security & Crypto collection on WebdevToolbox — free, browser-based developer tools with no login required.

Tagged with

totp2faauthenticatorsecuritydeveloper-toolswebdevtoolbox

Related posts