How to Convert Hex to Base64 - Step by Step Guide
Enter Hexadecimal Data
Start by pasting your hexadecimal (hex) string into the input area. It can be one long run of digits or bytes split up the way your tool printed them.
Automatic Conversion
About a second after you stop typing, the bytes your hex describes are written out as standard Base64, with = padding at the end when the byte count needs it.
Copy or Download Result
Once encoded, copy the Base64 string to your clipboard or save it as a text file.
What is Hex to Base64 Encoding?
Hexadecimal (Hex) to Base64 conversion transforms hex-encoded data into Base64 format. This is crucial for cryptographic operations, API transmission, and working with binary data.
Hex encoding uses 16 symbols (0-9, A-F) while Base64 uses 64 characters. Converting between them is essential for hash functions, Web Crypto API, and data URIs.
Frequently Asked Questions
How do I convert Hex to Base64?
Paste the hex into the left panel. About a second after you stop typing, the Base64 appears on the right. Each pair of hex digits is one byte, and those bytes are what gets encoded, so 48656C6C6F (the bytes of "Hello") becomes SGVsbG8=. The Sample is the text "Network Tower 5G-001" written as hex.
Which hex formats can I paste?
Plain runs like 48656C6C6F, bytes split by spaces, line breaks, colons, dashes or commas (48 65 6C, de:ad:be:ef), 0x and \x prefixes (0x48, 0x65 or \x48\x65), a C or JavaScript array such as {0x48, 0x65}, and a value still inside its quotes. Upper and lower case both work. A single digit after 0x, as in 0x5, is read as the byte 05.
Can I paste the output of xxd or hexdump?
Yes, the output of xxd and hexdump -C. The offsets on the left and the text column on the right are skipped and only the hex bytes are used. A "*" line, which hexdump prints for repeated rows, is filled back in from the offsets. The od command and plain hexdump without -C are refused on purpose: they print 2-byte words with the bytes swapped on most machines, so reading them as hex would give the wrong data.
What happens if my hex has a mistake in it?
You get an error instead of a wrong result. A character that is not a hex digit is named with its line and column, and an odd number of digits is reported too, since every byte needs exactly two. If what you pasted is already Base64, the message points you to Base64 to Hex, and for ordinary text there is Text to Base64.
When is Hex to Base64 useful?
Mostly when a value comes out of one tool as hex and another tool wants Base64. Hash digests are a common case: sha256sum prints hex, while HTTP headers such as Digest and many APIs expect Base64. Keys, signatures, IVs and binary file headers copied from a debugger or a hex editor are others.
Is my data sent anywhere?
No. The conversion runs in your browser, nothing is sent to our server, and nothing is kept: reload the page and the editor is empty. Bear in mind that Base64 is only a different way of writing the same bytes, not encryption, so anyone with the string can turn it back into hex.
How much hex can I paste at once?
A megabyte of hex (half a megabyte of bytes) converts in a moment. The Base64 is about two thirds the length of the hex, because Base64 packs 6 bits into each character where hex packs 4. Very large inputs mostly slow down the editor, not the conversion.
Related Tools
Base64 to Hex
Decode Base64 encoded strings to hexadecimal format for cryptography and binary data
Binary to Base64
Encode binary data (0s and 1s) to Base64 format for data transmission
Base64 to Binary
Decode Base64 to binary format (0s and 1s) for debugging and bit-level analysis
ASCII to Base64
Encode ASCII text to Base64 format for embedded systems and protocols
Base64 to ASCII
Decode Base64 to ASCII text for legacy systems and serial communication
UTF-8 to Base64
Encode UTF-8 text to Base64 with international characters and emojis