Random Hex Generator

Generate random hexadecimal strings of any length, from short codes to 256-character tokens. Lowercase hex from a secure random source.

Hex strings of any length

Hexadecimal uses the digits 0 to 9 and the letters a to f, so each character carries exactly 4 bits: 32 hex characters is 128 bits, 64 is 256 bits. Unlike the encryption key generator, which works in whole bytes, this tool takes any length, including odd lengths like 7 or 13 characters for short codes.

Common uses

  • Short IDs, commit-style hashes and test data.
  • Nonces and tokens where a system expects hex.
  • Placeholder values for config files and documentation.

Frequently asked questions

How many bits is a hex string?

Multiply the length by 4. A 40-character hex string has 160 bits.

Uppercase or lowercase?

Hex ignores letter case, so both mean the same value. This tool outputs lowercase, the most common convention.