About this tool
Generates hexadecimal strings from cryptographically secure random bytes, handy for nonces, salts, test IDs and keys. Each hex digit carries 4 bits, so 32 digits equal 128 bits and 64 digits equal 256 bits. Everything is created locally in your browser.
How to use Random Hex Generator
- Enter the number of hex digits you need.
- Choose how many strings to make.
- Toggle uppercase or the 0x prefix if your code expects it.
- Copy or download the results.
Frequently asked questions
How many hex digits do I need for a 256-bit key?
64 hex digits, since each digit encodes 4 bits.
Is uppercase or lowercase better?
They represent the same value. Use whichever your system expects; lowercase is more common.