HomeDeveloper toolsTOTP / 2FA Generator

TOTP / 2FA Generator

Generate RFC 6238 one-time codes from a Base32 test secret.

Processing stays in your browser. Generated codes are snapshots; press Run again to refresh. Match the secret, digits, algorithm, and period to the authenticator. Secrets are not stored.

How to use the totp / 2fa generator

Generate RFC 6238 one-time codes from a Base32 test secret. Complete the base32 secret, hmac algorithm, code digits, time step (seconds), unix seconds (blank for now) fields above. Choose Run tool, review the output, then copy or download the result.

Example

The RFC SHA-1 test secret at Unix time 59 produces 94287082 with 8 digits.

Good to know

Generated codes are snapshots; press Run again to refresh. Match the secret, digits, algorithm, and period to the authenticator. Secrets are not stored.

Separate representation, integrity and trust

Use public test values for the first run and identify exactly what property you want to inspect. Encoding makes data representable in another format; hashing produces a digest; signing and encryption have different purposes. A readable token, matching digest or parsed key does not by itself establish who created the data or whether it should be trusted. The scope stated on this page is the boundary of the result.

Inputs and settings explained

Base32 secret
Use a public test value to establish the expected behavior first. For a real operation, follow your own credential-handling rules. Keep this value out of screenshots, exported examples and support messages; a demonstration value is not a suitable production secret.
HMAC algorithm
Choose the hmac algorithm setting that matches your task. Available choices: SHA-1; SHA-256; SHA-512. The supplied example selects SHA-1. Compare the result after changing this setting; the options describe different operations or conventions.
Code digits
Choose the code digits setting that matches your task. Available choices: 6; 8. The supplied example selects 6. Compare the result after changing this setting; the options describe different operations or conventions.
Time step (seconds)
Enter a numeric value for time step (seconds), using the units and bounds indicated by the label and method notes. The demonstration uses 30. Check signs and scale before calculating; a percentage, fraction and whole-number count have different meanings.
See the demonstration value
30
Unix seconds (blank for now)
Enter a numeric value for unix seconds (blank for now), using the units and bounds indicated by the label and method notes. The demonstration uses an empty value. Check signs and scale before calculating; a percentage, fraction and whole-number count have different meanings.

How to review the result

Compare the exact bytes and encoding used by the other system. Spaces, line endings, Unicode encoding and Base64 variants can all affect the result. For cryptographic material, confirm algorithms and parameters against the protocol you are implementing. Do not put real credentials in a bug report or screenshot. Review any external-service disclosure before starting a lookup; a service-assisted check has different data handling from a local transformation.

  • Confirm the expected encoding, algorithm and byte sequence with a public known example.
  • Get comparison values and trust anchors from an independent source you trust.
  • Keep generated secrets out of shared downloads, source control and support messages.

Common questions about this workflow

Does decoding or inspecting a token verify it?

No. Reading fields and checking syntax are separate from verifying a signature, issuer, audience, expiry and the surrounding application's policy. Use the verification procedure required by the actual protocol.

Does no reported issue prove that a value is safe?

No. The result covers the checks described on this page and the supplied input only. A local utility cannot establish every security property, and a lookup may have incomplete coverage. Apply your application's complete validation and key-management requirements.

Built by DevBricks Technologies. Found an unexpected result in TOTP / 2FA Generator? Report a reproducible example with the tool URL, settings and a small sample that contains no private information.