#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
🔢 FREE · RFC 6238

TOTP Code Generator: Test 2FA Like an Authenticator App

Enter a Base32 secret and see the same rolling codes Google Authenticator would show.

  • ⏱️ Live code and countdown
  • ⚙️ SHA-1/256/512, 6 or 8 digits
  • 🔗 otpauth:// setup link

How to use the TOTP 2FA Code Generator

  1. 1. Enter a secretPaste the Base32 key from a test account, or create a new random one.
  2. 2. Match the settingsAlgorithm, digits and period, usually SHA-1, 6 digits and 30 seconds.
  3. 3. Show codesSee the current, previous and next codes and the otpauth:// link for a QR code.

How TOTP works

Time-based one-time passwords combine a shared secret with the current time. Every 30 seconds the counter (Unix time ÷ 30) goes up by one; the app computes an HMAC of the counter with the secret and turns part of it into a 6-digit code. Your server does the same, so both agree without talking to each other. The secret is usually shown as Base32 text and inside the QR code you scan, as an otpauth:// link. Everything is calculated in your browser; nothing you enter is uploaded.

This tool is for developers and testers building or checking 2FA. All 18 test vectors in the RFC 6238 standard (SHA-1, SHA-256 and SHA-512) produce exactly the published codes.

Worked example

The sample secret JBSWY3DPEHPK3PXP is a well-known test key used in many tutorials. With SHA-1, 6 digits and a 30-second period, the tool shows a new code every half minute, with a bar counting down. Show codes and setup link also lists the previous and next codes (servers usually accept one step either side for clock drift) and the link otpauth://totp/Uncodemy%20Demo:asha%40example.com?secret=JBSWY3DPEHPK3PXP&issuer=Uncodemy%20Demo.

Use it safely

  • Only use test secrets here. A real account's secret is as sensitive as its password, so never paste one into any website.
  • If codes don't match, check the device clock first; TOTP needs it within about 30 seconds.
  • Paste the setup link into our QR code generator to scan it with an authenticator app.

Frequently asked questions

Which apps work with these settings?

Google Authenticator, Microsoft Authenticator, Authy and most others use SHA-1, 6 digits and 30 seconds by default; some ignore other settings.

What's the difference between TOTP and HOTP?

HOTP uses a counter that goes up with each use; TOTP uses time, so codes expire on their own.

Is the TOTP generator free?

Yes. You can open the TOTP generator and use every option without signing up. When you show the codes for the first time, we ask once for your name and WhatsApp number; after that it, and every other Uncodemy tool, opens straight away.

More free tools

See all free tools