Hex to Base64 Converter
Convert hexadecimal byte data to Base64 instantly. Enter spaced hex bytes, continuous hexadecimal, 0x-prefixed values or common hex-dump style input and encode the exact byte sequence into standard Base64 or Base64URL.
—
—
—
Hex to Base64 Converter
The Hex to Base64 Converter turns hexadecimal byte values into a Base64 encoded string. Each pair of hexadecimal digits represents one byte, and the converter encodes those exact bytes rather than treating the hexadecimal input as ordinary text.
This is useful for developers, network engineers, embedded programmers and anyone working with byte arrays, hexadecimal payloads, file signatures, cryptographic values, API data or protocol messages that must be represented using Base64.
How to Convert Hex to Base64
Enter hexadecimal data into the converter. You can use spaces between bytes, paste a continuous hexadecimal string, add 0x prefixes or use common separators such as commas and colons.
Click Convert Hex to Base64. The calculator validates the hex, converts each byte pair into its numeric byte value, and then applies Base64 encoding to the resulting byte array.
Hex:
48 65 6C 6C 6F
Decimal:
72 101 108 108 111
Binary:
01001000 01100101 01101100 01101100 01101111
Base64:
SGVsbG8=Hexadecimal Bytes and Base64
Hexadecimal is a compact representation of bytes. One hexadecimal digit represents four bits, so two hexadecimal digits represent exactly one eight-bit byte.
Hex byte:
4D
Binary:
01001101
Decimal:
77
Base64 for this one byte:
TQ==Hex to Base64 Example: ABC
The bytes 41, 42 and 43 correspond to three byte values. Since Base64 processes three-byte blocks naturally, this example produces four Base64 characters without padding.
Hex:
41 42 43
Binary:
01000001 01000010 01000011
Combined:
010000010100001001000011
Base64:
QUJDContinuous Hexadecimal Input
Spaces are not required. A continuous hexadecimal string is divided into two-digit byte pairs automatically.
Spaced:
48 65 6C 6C 6F
Continuous:
48656C6C6F
Both represent:
48 65 6C 6C 6F
Base64:
SGVsbG8=0x-Prefixed Hex Input
Developers frequently write hexadecimal values using a 0x prefix. The converter accepts those prefixes and removes them before processing the byte data.
Accepted:
0x48 0x65 0x6C 0x6C 0x6F
Equivalent to:
48 65 6C 6C 6FBase64 Padding From Hex Bytes
Base64 works with groups of three original bytes. When the number of hex bytes is not divisible by three, standard Base64 adds padding characters.
| Hex Input | Bytes | Base64 | Padding |
|---|---|---|---|
| 4D | 1 | TQ== | 2 × = |
| 4D 61 | 2 | TWE= | 1 × = |
| 4D 61 6E | 3 | TWFu | None |
Standard Base64 and Base64URL
The converter can generate either standard Base64 or Base64URL. Both represent the same underlying bytes, but Base64URL uses characters that are safer inside URLs and filenames.
| Index | Standard Base64 | Base64URL |
|---|---|---|
| 62 | + | – |
| 63 | / | _ |
This tool also removes trailing equals-sign padding when Base64URL output is selected.
Hex Text vs Hex Byte Encoding
There are two very different operations that are sometimes both called “hex to Base64.” Correct byte conversion means that hexadecimal 48 represents one byte with decimal value 72.
Hex byte:
48
Byte value:
72
Correct byte Base64:
SA==
Literal text:
"48"
ASCII bytes:
34 38
Different Base64:
NDg=This BinaryCon tool performs the first operation: hexadecimal byte data is decoded into bytes before Base64 encoding.
Where Hex to Base64 Conversion Is Used
Hex-to-Base64 conversion appears in software development, web APIs, network protocol analysis, cryptographic workflows, firmware debugging, binary file inspection and data interchange. Documentation may provide a value as a hex dump while another system expects the same bytes as Base64.
The binary, decimal and normalized-hex outputs on this page make it easier to confirm that the exact intended byte sequence was encoded.