Hex Key Generator
Generate cryptographically secure hexadecimal keys and tokens. Perfect for API secrets, session tokens, and encryption keys.
Click Generate to create secure API keys
Key Statistics
Keys are generated entirely in your browser using the Web Crypto API. No key is ever stored or sent to a server.
API Key Generator FAQ
Why is a hex key longer than the other formats at the same strength?
Hex carries exactly 4 bits per character, against about 5.95 for Base62 and exactly 6 for Base64, so hex needs roughly one and a half times as many characters for the same strength. 32 hex characters is 128 bits, where the same 32 characters of Base64 is 192.
Should I keep the length even?
Yes, if anything downstream will decode the key back into bytes. The generator takes one random byte per two hex characters and then trims the string to the length you asked for, so an odd length stops halfway through a byte and no longer represents a whole number of bytes.
Which characters appear in a generated hex key?
The random portion uses only the digits 0 to 9 and the lowercase letters a to f. If you set a prefix it is joined on with an underscore, so a prefixed key is no longer pure hex and the prefix has to be stripped before anything tries to decode it.
Where is hex the conventional choice?
Wherever the value is really bytes rather than text: digests, raw key material, and anything a counterpart will decode back to the exact byte sequence. Each pair of characters is exactly one byte, which makes that round trip unambiguous in a way the denser formats are not.
Need to share API keys securely?
Don't paste API keys into Slack or email. Use CredenShare to deliver them with end-to-end encryption, expiration, and audit logging.