xotp logo

XOTP

Playground
Configuration
DurationToken validity period (30s is standard)
DigitsOTP length (6 digits recommended)
HMAC algorithm (sha1 for Google Authenticator)

Base32 encoded secret key (auto-generated if empty)

User identifier

Service name

Display labels for authenticator apps
Live Result

0

Generated Code
import { Secret, TOTP } from 'xotp';

const secret = Secret.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567', 'base32');
const totp = new TOTP({
algorithm: 'sha1',
digits: 6,
duration: 30,
issuer: 'XOTP',
});

const token = await totp.generate({ secret });
const keyUri = totp.toKeyUri({
secret,
account: 'Foo',
});