Hex to Base64 Converter
Convert a hexadecimal string into Base64. The parser accepts spaces, colons, dashes, 0x and \x prefixes, so you can paste hex from almost any source without cleaning it up first.
How to use the Hex to Base64
- 1 Paste a hexadecimal string into the box — spaces, colons and 0x prefixes are tolerated.
- 2 The Base64 equivalent appears immediately, padded correctly to a multiple of four characters.
- 3 Check the byte count shown alongside, which confirms the hex was read as whole bytes.
- 4 Copy the result, or paste it into Base64 to Hex to reverse the conversion.
How It Works
All non-hexadecimal characters are stripped, then the remaining nibbles are paired into bytes and encoded as Base64. Odd-length input is rejected so you always get a clean result.
- Ignores spaces, colons, dashes, 0x and \x
- Standard or URL-safe Base64 output
- Optional padding for URL-safe mode
- ASCII preview and byte count
- Live validation of hex input
Frequently asked questions
What happens if my hex has an odd number of digits?
It cannot be read as whole bytes, so the tool reports it as invalid rather than guessing. Add a leading zero or remove the stray digit — an odd-length hex string almost always means a copy-paste error.
Can I paste hex with colons, like a MAC address?
Yes. Colons, hyphens, spaces and "0x" prefixes are all stripped before conversion, so pasting a MAC address or a dump straight from a debugger works without manual cleanup.
Why is Base64 shorter than the hex string?
Hex spends two characters per byte; Base64 spends roughly four characters per three bytes. That is why Base64 is about 33% larger than the raw data while hex is 100% larger — Base64 is the more compact of the two.
Related Developer Tools
You might also need
Tools from other categories that people pair with the Hex to Base64: