Secret key generator
Generate 128 to 512-bit random secret keys as hex, Base64 and Base64URL.
Key size
32 random bytes from your browser's secure random source. The three rows are the same key, written three ways.
Secret key
- Hex
Making a key - Base64
Making a key - Base64URL
Making a key
Missing a feature or found a bug in Secret key generator? Tell me on X (@_andrewtran) or by email.
How to use Secret key generator
- Choose a key size. 256 bits suits most uses.
- Copy the key in the form your system expects.
- Select Generate again for a new key.
Questions and answers
Is my key sent anywhere?
No. It is made by your browser on this device and is not stored. Once you leave the page it is gone.
Which form should I use?
They are the same key. Hex is the most widely accepted, Base64 is shorter, and Base64URL is safe to put in a URL or a file name.
Is it random enough for production?
Yes. The bytes come from the same secure random source that browsers use for encryption.
Related tools
YAML formatter
Format and validate YAML with even indentation, and see the line of any error.Placeholder image generator
Make a dummy image of any size and colour, as SVG, PNG or a data URI to paste into code.Favicon generator
Turn an image, letter or emoji into favicon.ico, PNG icons, an Apple touch icon and a web manifest.App icon generator
Make every iOS and Android app icon from one image, letter or emoji, ready for Xcode and Android Studio.