OTP Auth URI Generator
Create the otpauth:// provisioning URI that Google Authenticator, Aegis, 1Password and friends scan as a QR code. Generates a random base32 secret on-device or validates one you paste in.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
Building the URI an authenticator scans
This generates an otpauth:// provisioning URI for TOTP or HOTP. It produces a fresh base32 secret with crypto.getRandomValues, or validates and normalises a base32 secret you paste. The output is the URI plus a "Secret (base32)" line for apps that cannot scan a QR code.
Enrolment for a service you are building
Use it to construct the enrolment link or QR payload for your own app, to check that the URI your backend produced is well-formed before shipping, or to mint a secret for a test account. Hand the output to any QR generator and the authenticator picks up the issuer, account and parameters.
The parameters that matter
Type switches between time-based TOTP, which uses Period (15–120 s, default 30), and counter-based HOTP, which uses Initial counter instead. Issuer and Account shape the label the user sees. Secret (base32, empty = generate) lets you supply your own; otherwise Random secret bytes (16–64, default 20) decides the entropy. Code digits selects 6 or 8 and Hash algorithm SHA1, SHA256 or SHA512.
Caveats
The tool builds the URI only — it never computes a live code. Issuer and account are percent-encoded in the path and the parameters URL-encoded, as the Key URI Format requires. A pasted secret must use only A–Z and 2–7, and padding is stripped before use.
Generated on your device
The random secret comes from the browser's cryptographic random source and never leaves the page; no URI or secret is uploaded. Treat a 2FA secret like a password anyway, because whoever holds it can generate your codes.
Questions
Does this show my current 6-digit code?
No — this tool builds the provisioning URI only. Computing a live code needs the current time and HMAC; pair the URI with the QR Code Generator to enrol in your authenticator app.
Is my secret safe?
It is generated in your browser with crypto.getRandomValues and never leaves the device. Still, treat any 2FA secret like a password: anyone who has it can generate your codes.
Which parameters do authenticator apps actually read?
Almost all of them read secret, issuer and account, and TOTP apps also honour digits, algorithm and period. HOTP apps need counter. Some older clients ignore the algorithm parameter and assume SHA1, so a SHA256 URI may not scan correctly everywhere.
Related tools
See categoryQR Code Generator
Generate QR codes for text, URLs, Wi-Fi, email, SMS and locations as crisp SVG.
Random String Generator
Generate random strings from a chosen character set with an unbiased browser CSPRNG.
HMAC Generator
Compute an HMAC of text with a secret key using SHA-1, SHA-256, SHA-384 or SHA-512.
Barcode Generator
Create Code 128, Code 39, EAN-13/8, UPC-A, ITF-14 and DataMatrix barcodes as crisp, scannable SVG.