About the Hexadecimal to Base64 Converter
Hex is easy to read but wasteful: every byte costs two characters. Base64 spends four characters on every three bytes, so the same data shrinks by about a third. That matters when a key, a nonce or a signature has to travel inside an HTTP header, a YAML value or a query parameter that has a length budget.
Paste the digits in whatever shape you copied them. Spaces, colons, commas, semicolons, underscores, hyphens and line breaks are all ignored, and 0x or \x prefixes are removed before conversion, so a fingerprint copied from OpenSSL and a byte array copied from a debugger both work untouched. The digits are matched in pairs, and an odd digit count is reported with the exact number found instead of silently dropping a nibble.
The URL-safe checkbox swaps + and / for - and _ and removes the trailing equals signs, which is the alphabet that JSON Web Tokens, cookie values and path segments expect. Line wrapping at 64 or 76 characters produces the block layout used by PEM files and MIME mail bodies. Nothing is transmitted, so a private key fingerprint is safe to convert here. Reverse the operation with Base64 to Hex.
How to use
- Paste hexadecimal digits in any layout: spaced pairs, colons, a solid run or
0xvalues. - Tick URL-safe alphabet when the result goes into a token or a URL.
- Choose a wrap width if the output belongs in a PEM block or an email header, then copy it.
Common questions
- Do I have to remove the colons from a certificate fingerprint?
- No. Colons, spaces and line breaks are stripped for you before the bytes are read.
- What happens with an odd number of digits?
- You get an error naming the digit count, because a byte always needs two digits and guessing which nibble is missing would corrupt the data.
- Is uppercase hex accepted?
- Yes. Case is irrelevant for hexadecimal input, so AF and af give the same byte.
- Why is my Base64 shorter than the hex I pasted?
- Base64 stores three bytes in four characters while hex uses six, so the encoded form is roughly a third shorter.