Random Hex Generator
Generate random hexadecimal strings of any length.
Loading tool…
About this tool
Random Hex Generator produces random hex strings — the compact text form of random bytes. Developers use them for nonces, salts, initialization vectors, test fixtures, and anywhere a fixed alphabet of 0–9/a–f is expected.
Each hex character carries 4 bits of entropy, so a 32-character string equals 128 bits. Output uses crypto.getRandomValues and never leaves your browser.
How to use
- Set the string length in hex characters.
- Choose how many strings to generate.
- Click generate.
- Copy or download the results.
Frequently asked questions
Four bits per character: 16 chars = 64 bits, 32 chars = 128 bits, 64 chars = 256 bits. The tool displays this for your chosen length.
This tool outputs lowercase, the most common convention (matching most hash digests). Hex is case-insensitive, so it parses identically anywhere.
Hex is simpler and universally parseable but 33% longer than Base64 for the same entropy. Use hex when an API or format expects it; otherwise URL-safe tokens are more compact.
Completely — crypto.getRandomValues runs locally in your browser.