Loading Hex to Base64 converter...

How to Convert Hex to Base64 - Step by Step Guide

Step 1

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.

•
Paste hex: Digits 0-9 and A-F, upper or lower case
•
Flexible format: Spaces, line breaks, colons, dashes, commas, 0x and \x prefixes, or xxd / hexdump -C output
•
Try sample: Click "Sample" to test with example hex data
Step 2

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.

•
Bytes, not characters: Every two hex digits are one byte, and every 3 bytes become 4 Base64 characters
•
Clear errors: A non-hex character is named with its line and column, and an odd digit count is reported
•
Hashes and keys: Turn a hex digest from sha256sum into the Base64 form many APIs ask for
Step 3

Copy or Download Result

Once encoded, copy the Base64 string to your clipboard or save it as a text file.

•
Copy to clipboard: One click copies the whole string
•
Download output: Save the Base64 as a .txt file
•
Stays in your browser: Nothing is uploaded to our server or kept after you leave

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.