Generate random hexadecimal values for colors and data.
The random hex generator builds a hexadecimal string of the length you pick, from 8 to 19 digits. Hexadecimal is base-16, using 0-9 and a-f, so each digit packs four bits - a compact way to write byte values, colour codes and identifiers. Pick a length, generate, and copy.
The string is produced in your browser with JavaScript's Math.random(). That is ideal for mock IDs, sample colour codes and test data, but it is pseudo-random rather than cryptographically secure, so do not use it for keys or secrets - reach for the secret-key or password generator instead.
Mocking up object IDs or commit-style hashes, sketching colour values (a six-digit hex is a CSS colour), seeding test fixtures, or producing throwaway reference codes. For anything that must be unguessable, use a cryptographically secure generator rather than this one.
Each click reshuffles every digit, so you can grab several distinct strings in a row for fixtures or sample IDs. Just remember it is sample randomness, not secure randomness.
Standard hexadecimal: the digits 0-9 and the letters a-f. Each character represents four bits.
Yes. A six-digit hex string is a valid CSS colour, for example a3f0c2, so set the length to 6 and prefix it with # when you use it.
No. It uses Math.random(), which is pseudo-random and predictable. For secure tokens or keys, use the secret-key or password generator instead.
No. The hex string is generated in your browser and never sent to our server.