Random Hex Token Generator

Press Generate for a 64-character random key that a program can keep in a settings file.

FluffyShield Protected workspace
FluffyShield

Isolated workspace: other page scripts can't read your files. How FluffyShield works

Free · No upload · No sign-up · No usage quotas

The setup instructions say: paste a random secret key here

You won't ever type this one from memory. It's for the program, and it has to arrive in one piece.

Only 0 to 9 and a to f

A token is a secret a program checks instead of a password: a key for a service, the code in a password-reset link, the value a website signs its cookies with. You copy it once into a file or a setting, and after that only machines read it.

What can go wrong is the trip. A web address treats # and & as signposts, so a password with those symbols in it gets rewritten or cut short on the way. A JSON file, the kind of settings file many programs use, needs a backslash in front of some characters. Hex skips all of that. It's written with only the digits 0 to 9 and the small letters a to f, and every place we tried takes those as they are.

In a settings fileSECRET_KEY=6a6236bbaa8f23f8c2d1ff3d8a4fa3eebed159f2b301632577b7aaa0f6a0ea23In a web address…/reset?token=6a6236bbaa8f23f8c2d1ff3d8a4fa3eebed159f2b301632577b7aaa0f6a0ea23In a JSON file"secret": "6a6236bbaa8f23f8c2d1ff3d8a4fa3eebed159f2b301632577b7aaa0f6a0ea23"A password, in the same web addressTypedTr&ck#42SentTr%26ck%2342

Token, then a password

Only the password had to be rewritten before the web address could carry it. How we checked

Why 32 bytes come out as 64 characters

The tool doesn't pick characters. It asks the browser for random bytes, from the same source browsers use for encryption keys, and then writes them down. A byte is a small number from 0 to 255, so it has 256 possible values. A bit is one yes-or-no choice, and eight of them give 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 = 256 combinations, so a byte is eight bits.

One hex character has sixteen possible values, which is four bits, so it takes two characters to write a byte. That's why the length doubles: the opening 32 bytes print as 64 characters and carry 256 bits of randomness. If the instructions ask for a length in characters instead, halve it to get the number of bytes.

Making a token

The Password Generator opens on this page with Type already set to Hex token.

  1. In Random bytes, type the number the program's instructions ask for, or use − and +.

  2. Press Generate to draw the bytes.

  3. Press Copy and paste the token into the file or setting that asked for it.

    The Result pane with a 64-character hex token, the line about 256 bits of randomness, and the Copy button outlined.
    The Result pane with a 64-character hex token, the line about 256 bits of randomness, and the Copy button outlined.

If a person has to type it

A string of 64 letters and digits with no pattern is miserable to read out or remember, and they don't need to be. For a password you'll type yourself, the Passphrase Generator gives you words instead.

Search FluffyBench