Developer Tools TutorialTested & Verified100% In-Browser Privacy

How to Generate TOTP Codes for Testing (RFC 6238)

Implementing TOTP correctly needs something to check against, and the failure modes are subtle enough that "it works on my machine" is not evidence. This produces RFC 6238 codes from a generated test secret, shows the drift window, and gives you the otpauth URI.

Quick Summary

A random test secret is generated for you. You get the current code, the previous and next ones, and the otpauth URI.

TOTP Generator - Step-by-Step Tutorial & Verified Guide
Developer Tools WorkflowTOTP Generator
Verified Step-by-Step Guide
Execution Architecture

Workflow Lifecycle & Pipeline

Visual execution flow showing how TOTP Generator processes data directly in your local browser sandbox.

TOTP Generator Interactive Process Pipeline

Fast, zero-latency execution directly in your browser memory.

3 Easy Steps
1
INPUTEnter base32 secret (leave empty to generate one)
2
PROCESSPress Generate Code
3
DOWNLOADDownload the TXT
Process Architecture • TOTP GeneratorInteractive Workflow Graphic
Input SourceSOURCE
Unprocessed Asset
In-Browser EngineWebCrypto & AST Syntax Evaluator
0% Server Upload100% Private
Verified ResultTARGET
Ready for Production
Figure 1.1: Verified end-to-end processing pipeline for TOTP Generator. Data is transformed entirely within local browser memory with zero network roundtrips.
Pre-Flight Readiness

Before You Start

Ensure your source assets and browser environment meet the verified execution requirements.

Values for base32 secret (leave empty to generate one), digits and step (seconds)
A current browser with JavaScript on. TOTP Generator runs inside it, so nothing you enter is sent anywhere.
Interactive Walkthrough

Step-by-Step Instructions

Follow these verified steps to execute the task with TOTP Generator.

Step 014 fields

Enter base32 secret (leave empty to generate one)

Fill in base32 secret (leave empty to generate one), digits and step (seconds), plus the 1 below. Each starts at a usable value, so you can change one and leave the rest.

Input Example
Base32 secret (leave empty to generate one) blank · Digits 6 · Step (seconds) 30
Expected Output
4 fields read on run
Helpful Tip: Type or paste straight into the page — there is no file to pick.
Step 02Generate Code

Press Generate Code

Generate Code starts the work in this tab. Nothing is uploaded, so how long it takes is down to your own device.

In-Browser Client Execution (0 ms Network Delay)HTML5 WASM
Input: Generate CodeTOTP Generator runs on your device
Helpful Tip: Runs in this tab. Nothing is uploaded, so the speed is your device's.
Step 03Download

Download the TXT

The result appears with a download button, as TXT. It was made on your device, so nothing has to be cleaned up afterwards.

Processing Complete • Zero Server RetentionTXT saved to your device
Download Output File
Helpful Tip: Comes back as TXT.
Runtime Virtualization & Sandbox Architecture

Under the Hood: Sandboxed WASM Execution & Isolated Web Workers

Development tools and code sandboxes execute inside sandboxed Web Workers with isolated thread runtimes. Code scripts cannot access DOM scopes, cookies, or local network interfaces, providing high security and bare-metal performance.

Real-Time Stdin Stream

Interactive inputs pipe directly into std::cin, sys.stdin, and ReadLine buffers via simulated virtual teletypes.

Zero Egress Guarantee

Algorithm logic, API keys, and test queries remain confined to the client virtual machine.

Near-Native CPU Performance

Precompiled WebAssembly modules execute with near-native JIT performance on V8 and SpiderMonkey engines.

Configuration Options

Settings & Options Explained

Fine-tune quality, format, and compression parameters for your exact workflow.

Settings & Configuration Guide

SettingRecommended ValueHow It Works & Impact
Base32 secret (leave empty to generate one)Leave it blank unless you need it

Never paste a real 2FA secret into any web page, including this one. Takes text.

Impact: Read as written, so stray spaces and characters count.
Digits6

Takes one of 6, 7 or 8.

Impact: Each option is a different digits; switching it changes the result, not the speed.
Step (seconds)30

Takes one of 15, 30 or 60.

Impact: Each option is a different step (seconds); switching it changes the result, not the speed.
AlgorithmSHA-1

Takes one of SHA-1, SHA-256 or SHA-512.

Impact: Each option is a different algorithm; switching it changes the result, not the speed.
Optimization Advice

Best Practices & Key Considerations

Avoid common quality pitfalls and maximize output performance.

Expert Recommendations

  • Never paste a real 2FA secret into any web page, including this one. It grants account access on its own, never expires, and cannot be rotated without re-enrolling. The tool generates a random 160-bit secret by default for exactly this reason.
  • Three codes are shown because a correct verifier accepts the previous and next step as well as the current one — ±30 seconds in the standard configuration. Confirm yours accepts that set and rejects a step beyond it.
  • SHA-1 is not a weakness here. The collision attacks that retired SHA-1 for certificates do not apply to HMAC, which relies on a different property. SHA-256 and SHA-512 are allowed by the RFC but almost nothing in the wild uses them.
  • When a real service rejects correct codes, it is almost always device clock drift rather than a wrong secret. Check the clock against a reference before suspecting anything else.
  • Pair the otpauth URI with the QR code generator on this site to see the whole enrolment flow an authenticator app goes through.

Common Mistakes to Avoid

  • Leaving Digits on 6 when 7 or 8 was wanted.
  • Assuming the input is sent somewhere — TOTP Generator runs in this tab, and nothing you enter leaves it.
Diagnostics

Troubleshooting & Fixes

Quick solutions for common browser constraints, format issues, and edge cases.

Troubleshooting & Common Issues

The answer is right but not in the form you wanted

Possible Cause: Digits is set to 6, and it decides that.

Solution: Switch Digits to 7 or 8 and run it again.
100% In-Browser Privacy Guarantee: TOTP Generator processes data strictly inside your local device memory using HTML5 Canvas and WebAssembly. Your files and data are never transmitted or stored on any remote server.
Common Inquiries

Frequently Asked Questions

Everything you need to know about formats, privacy, and browser support.

No, and you should not. It generates a test secret rather than accepting a real one, because a TOTP secret pasted into a web page is a liability.