UTILS.
Private by default
⧖

TOTP / 2FA Code

Generate a time-based one-time passcode from a Base32 secret, refreshed every second.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

Compute the current TOTP two-factor code from a Base32 secret directly in your browser, with a live seconds-remaining display.

The code is computed with HMAC-SHA1 through the Web Crypto API. The Base32 secret is decoded (A-Z and 2-7, case-insensitive; spaces and trailing = are ignored), the device clock time is divided by the period to get a counter, and the signature is truncated to 6, 7 or 8 digits. Defaults are 6 digits and a 30-second period; the period is a whole number of at least 1. No other hash is offered.

The code and the seconds left refresh every second. The secret is used only inside the page for this calculation; the tool's code makes no network request with it and does not store it. It is a plain text field prefilled with a sample secret. If your device clock is off, the codes will be wrong.

Frequently asked questions

What secret format is expected?
A Base32-encoded secret, the same format authenticator apps show when you set up two-factor authentication.
Why does the code change?
TOTP codes are derived from the current time divided into periods, so a fresh code appears at the end of each period.
Can I paste an otpauth:// link?
No. The field takes only the Base32 secret, so a link is rejected as invalid.
Does it support SHA-256 or SHA-512?
No. It always uses HMAC-SHA1.

More tools