Skip to content

Generate Token

Generate Token is a minimal static web app that instantly generates a cryptographically random 16-character hexadecimal token on page load. It uses the browser’s built-in Web Crypto API — no server, no dependencies, no build step. Refresh the page to get a new token.

The entire application lives in a single HTML file. On load, it requests 8 random bytes from window.crypto.getRandomValues(), converts each byte to a zero-padded hex string, and displays the resulting 16-character token:

const array = new Uint8Array(8);
window.crypto.getRandomValues(array);
const token = Array.from(array)
.map(byte => byte.toString(16).padStart(2, '0'))
.join('');

This produces tokens like a3f1c9e07b2d4a86 — suitable for quick test IDs, session tokens during development, or any scenario where you need a random hex string fast.

  • Cryptographically Random — Uses crypto.getRandomValues(), not Math.random()
  • Zero Dependencies — No npm packages, no frameworks, no build tools — just a single HTML file
  • Instant Generation — Token is generated and displayed on page load, no clicks required
  • Auto-Deploy — GitHub Actions workflow deploys to GitHub Pages on every push to main
LanguageHTML, JavaScript
APIWeb Crypto API (crypto.getRandomValues)
HostingGitHub Pages
CI/CDGitHub Actions

Try it out at jadujoel.github.io/generate-token.

The source code is available on the project’s GitHub repository.