
otpauth:// URI
Parse an otpauth:// key-provisioning URI into its fields, or build one from a TOTP/HOTP secret and settings, computed on your device.
otpauth:// URI reads a key-provisioning link apart into its type, issuer, account, secret, algorithm, digits and period or counter, or assembles one from those same pieces in build mode. Build mode rejects a secret failing base32 or a digit count outside 6 through 8. Parse mode takes whatever the link states, filling algorithm, digits and period with RFC defaults only when missing.
Questions
What does parse mode show?
The type, TOTP or HOTP, plus issuer, account, secret, algorithm, digits, and period for TOTP or counter for HOTP.
What does build mode check?
That secret is valid base32 and digits is a whole number between 6 and 8, before assembling the URI.
What if the secret is not base32?
Build mode refuses with "secret must be Base32 (A-Z, 2-7)".
What if a field is missing when I parse?
Algorithm, digits and period fall back to the RFC defaults, SHA1, 6 and 30, when the URI does not declare them.
What if the URI has no secret parameter?
Parsing refuses with "URI has no secret parameter".
Can I use this from the command line?
Yes, the same code runs on the page, the CLI and MCP.
Compare
| Tool | Runs on the CLI | Live as you type |
|---|---|---|
| otpauth:// URI | Yes | Yes |
| TOTP generator | Yes | Yes |
| HOTP generator | Yes | Yes |