Client-Side Engine · 100% Private & In-Browser

TOTP Generator

For testing an implementation, with a generated secret by default

Comprehensive Guide & Technical Mechanics

About TOTP Generator — Free Online Tool

TOTP Generator produces RFC 6238 codes from a random test secret by default, for checking an implementation — and says plainly that a real 2FA secret should never go into any web page.

HMAC via WebCrypto with RFC 4226 dynamic truncation. Shows the previous and next codes, because a correct verifier accepts a window of one step either side for clock drift.

Codes are derived from the secret inside this page. Nothing is transmitted — and that is still not a reason to paste a real secret.

Verifying your own TOTP implementation, understanding how enrolment works, testing a verifier’s drift window, and generating a test secret.

Also known as: 2fa code generator · authenticator code generator · otp generator · rfc 6238 totp · test totp secret · totp implementation test

When to use it

Because implementing TOTP correctly needs something to check against, and the failure modes are subtle enough that "it works on my machine" is not evidence.

How it works

The Unix time is divided by the step to give a counter. HMAC of that counter under the secret is truncated by the RFC 4226 dynamic-truncation rule and reduced modulo ten to the power of the digit count.

Why It Generates A Secret Rather Than Asking For Yours

A TOTP secret grants account access on its own — it is a password that never expires and cannot be rotated without re-enrolling. Pasting one into any web page is strictly worse than not doing so, regardless of what that page promises about where the data goes. This tool runs entirely in your browser and uploads nothing, and that is still not a good enough reason. So it generates a random 160-bit secret by default, which is what you want for testing anyway.

The Drift Window Is Why Three Codes Are Shown

TOTP depends on both sides agreeing what time it is. Phones drift, and a user may take fifteen seconds to type a code that was already near the end of its window. A correct verifier therefore accepts the previous and next step as well as the current one — a window of ±1, which is ±30 seconds in the standard configuration. All three are shown so you can confirm your verifier accepts the right set and rejects a step beyond it.

SHA-1 Is Not A Weakness Here

Almost every service uses HMAC-SHA-1 with six digits and a thirty-second step, and people reasonably ask whether SHA-1 is a problem. It is not: the collision attacks that retired SHA-1 for certificates and signatures do not apply to HMAC, which depends on a different property. SHA-256 and SHA-512 are offered because the RFC allows them, but almost nothing in the wild uses them and an app may simply fail against a non-standard configuration.

When Codes Are Rejected, It Is Usually The Clock

A correct secret and a correct implementation still fail if the device clock is wrong. On a phone, enabling automatic time fixes it; on a server, NTP. Before suspecting the secret, compare the device clock against a reference — TOTP is a time-based protocol and a two-minute drift breaks it completely, however correct everything else is.

Step-by-Step Tutorial

How to Use TOTP Generator in 4 Easy Steps

Follow this simple guide to process your files in seconds directly inside your browser tab.

01

Provide Input for TOTP Generator

Paste your payload, code snippet, or string into the TOTP Generator editor workspace. A generator for time-based one-time passwords — the six-digit codes an authenticator app produces — built to RFC 6238.

02

Configure Formatting & Validation Rules

Select indentation preferences, minification, encoding options, or validation rules. Because implementing TOTP correctly needs something to check against, and the failure modes are subtle enough that "it works on my machine" is not evidence.

03

Run In-Browser Engine

The engine executes TOTP Generator locally in your browser with microsecond latency and zero server transmission.

04

Copy or Download Output

Copy the sanitized, formatted, or generated output directly to your clipboard or download it for your project.

Core Advantages

Why Use TOTP Generator on ShortTrick

Engineered for maximum speed, strict privacy, and frictionless digital productivity.

Zero Code or Token Leaks

Proprietary source code, API keys, database queries, and tokens processed in TOTP Generator never leave your browser.

Microsecond Performance

Optimized AST parsers and Web Crypto APIs process large payloads in TOTP Generator in milliseconds.

Syntax Validation & Formatting

TOTP Generator highlights syntax errors and enforces standard formatting conventions automatically.

Offline Ready

Once loaded, TOTP Generator functions entirely offline without requiring an active internet connection.

Questions & Answers

Frequently Asked Questions About TOTP Generator

Common questions regarding TOTP Generator, data privacy, file format compatibility, and usage limits.

No. A TOTP secret grants account access on its own. The tool generates a random one by default for exactly this reason.

Search Queries & Intent

Common search phrases, secondary format tasks, and workflows users reach for when using this tool.

Direct Variations & Search Synonyms (8)

free totp generatortotp generator onlinebest totp generatortotp generator toolonline totp generator freefree online totp generator2fa code generatorauthenticator code generator

Specific Workflows & Long-Tail Queries (15)

how to use totp generator online freefastest totp generator without sign upbest online totp generator for mobile and pcinstant totp generator running in browsersecure totp generator with zero data uploadsfree totp generator with no watermarkbatch totp generator multiple fileshigh quality totp generator without losing qualityconvert txt to txt with totp generatorhow to use with totp generator on iphone and androidsafe and private totp generator tooltotp generator for students and professionalsbrowser based totp generator no software installationaccurate totp generator with instant resultsstep by step guide to totp generator

Semantic Standards & Technical Entities (20)

syntax highlightingcode formattingabstract syntax treeminificationbeautifierregex patternjson serializationapi payloadhash algorithmbase64 encodingurl encodingdeveloper utilityweb developmentclient side compilationzero server logsrfc standardtxt formatclient-side webassemblyzero server storagedrag and drop upload
Side by side

Identifiers and secrets are not the same thing

These all come out as a random-looking string, so they get used for each other’s jobs. The dividing line is whether the string is merely unique or must also be unguessable, and getting that the wrong way round is a security bug rather than a style choice.

Must be uniqueMust be unguessableExpiresSafe in a URL
UUID v4YesNot guaranteedNoYes
GUIDYesNot guaranteedNoYes
API keyYesYesWhen revokedNo
TOTP codeNoYesEvery 30 secondsNo
JWTYesIt is signed, not secretAt its exp claimOnly if short-lived

In practice: GUID is simply Microsoft’s name for a UUID, so the two tools produce the same thing. The one that catches people out is the JWT: it is signed, not encrypted, so anyone holding it can read every claim inside by decoding the middle section. Never put anything in a JWT payload that the bearer should not see.

Read the full comparison

Interconnected Utility Network

Explore complementary browser-based tools with zero file uploads and instant in-memory execution.

Knowledge Base

Related Reading & Tutorials

Guides, articles, and best practices for developer tools workflows.