64
64Encode

Hexadecimal to Base64 Converter

Convert hexadecimal byte strings (continuous, space-separated, colon-separated, or 0x-prefixed) into Base64 or Base64url.

Decode Base64 to Hex on 64Decode
Hexadecimal Input
Base64 Output
Technical Guide

Convert Hexadecimal Byte Strings to Standard Base64 or Base64url

When working with SHA-256 digests, AES encryption keys, UUIDs, or Subresource Integrity (SRI) hashes, you often need to convert raw hexadecimal bytes into Base64. Paste any hex format here for instant conversion.

Accepts Spaced, Colon-Separated & 0x-Prefixed Hex

Whether your hex bytes are continuous (48656C6C6F), space-separated (48 65 6C 6C 6F), colon-separated (48:65:6C), or 0x-prefixed (0x48 0x65), 64Encode strips delimiters and converts the exact raw bytes to Base64.

Why Hex-to-Base64 Differs from Text-to-Base64

Encoding the text "4865" treats each digit as an ASCII character, whereas Hex-to-Base64 parses 0x48 and 0x65 as raw binary bytes ("He"). To convert Base64 back to hex, use Base64 to Hex on 64Decode.

Frequently Asked Questions

Common Questions

What is the difference between Hex to Base64 and Text to Base64?

Hex to Base64 interprets pairs of hex characters (00-FF) as raw binary bytes before encoding, whereas Text to Base64 encodes the literal ASCII/UTF-8 characters.

Can I paste hex with 0x prefixes, spaces, or colons?

Yes. 64Encode automatically strips spaces, colons, hyphens, commas, and 0x prefixes before converting.

Why do I get an error about an odd number of hex characters?

Each byte requires exactly 2 hexadecimal digits (4 bits each). Make sure your hex string has an even number of hex characters.

Can I output URL-safe Base64url from hex?

Yes. Check the URL-Safe Base64url box in the toolbar to replace + and / with - and _.

How do I convert Base64 back to hexadecimal?

Click Decode Base64 to Hex to open the Base64 to Hex dump tool on 64Decode.com.