JS 实现

2FA 验证

双重验证码/两步验证码获取工具。支持纯 JavaScript 本地生成与校验,无需后端即可集成。

2FA 参数配置

TOTP · SHA-1 · 6位
当前验证码

------

剩余时间 30s

二维码

用 Google Authenticator / Microsoft Authenticator 等 App 扫码导入。

2FA 二维码

验证码校验

输入 6 位验证码进行校验,默认容忍前后各一个时间窗口。

本地验证记录

暂无验证记录。

2FA 使用说明

1. 输入共享密钥并确认 Issuer/账户标识。

2. 扫描二维码绑定到验证器 App,或复制 otpauth 链接手动导入。

3. 在校验框输入 6 位验证码,前端会用 JavaScript 本地校验。

T
ALL TOOLS · THE CATALOG
83 single-purpose utilities · runs local
Browse all →
All tools process files entirely in your browser · Your data never leaves your device

2FA Authenticator — Free, Browser-Based TOTP Generator

Generate time-based one-time passcodes (TOTP) right in your browser. Compatible with Google Authenticator, Authy, and any RFC 6238 service. Secrets are stored locally — never uploaded.

FreeNo sign-upRuns in your browserUtilitiesApplication

How TOTP codes work — and why yours might be rejected

A 2FA code is not sent to you; both sides compute it independently from a shared secret and the current time. Everything about TOTP that confuses people follows from that one design decision.

ParameterStandard valueWhat it means
AlgorithmHMAC-SHA1The default in RFC 6238 and what essentially every service issues
Digits6A few services issue 8 — the QR payload declares it
Period30 secondsA new code every 30 s, derived from Unix time divided by 30
SecretBase32 stringThe one value you must back up — the codes are derived from it
Drift windowUsually ±1 periodMost servers accept the previous or next code to tolerate clock skew

How to generate 2FA TOTP codes in your browser

  1. Add an account. Click Add, then either paste the secret key shown by your service, or scan the QR code with your webcam.
  2. Name the account. Set a label like "GitHub" or "AWS" so you can find the right 6-digit code at a glance.
  3. Copy the live code. A 6-digit code refreshes every 30 seconds. Click the code to copy it instantly into the login prompt.
  4. Back up your secrets. Export your secret list to a local JSON file as backup. Store somewhere safe (1Password, encrypted drive) — never email it.

Frequently Asked Questions

Are my 2FA secrets uploaded?
No. Secrets are stored only in your browser localStorage. No server, no sync, no telemetry.
Is this a Google Authenticator replacement?
Yes. It implements the same RFC 6238 TOTP standard. Any service that supports Google Authenticator will work with this tool.
What if I clear my browser data?
You will lose your secrets unless you exported the backup. Always keep an exported backup before clearing browser storage.
Can I scan QR codes from the screen?
Yes. Use your webcam to scan a QR code displayed on another device, or upload a screenshot of the QR code.
Does it work offline?
Yes. After first load, the tool runs entirely offline — TOTP only needs the secret and your device clock.
Why does my code not match?
TOTP requires accurate clock sync. If your device clock drifts more than 30 seconds, codes will be rejected. Sync your system time.

Use Cases

Related tools

More free, in-browser tools from the More Tools set — every one runs locally, with no sign-up and no upload.

Browse all free online tools →