Free Hex to Base64 Converter Online
Convert hexadecimal strings to Base64 and decode Base64 back to hex instantly in your browser. No upload, no server — fully private.
Input
Output
What Is Hex to Base64?
Hexadecimal is the format you see everywhere in debugging — memory dumps, cryptographic hashes, color codes, byte sequences in network packets. Base64 (RFC 4648) is what APIs, JWTs, email attachments, and data URIs use to transport binary data safely over text-based channels. This tool converts in both directions: paste hex bytes and get Base64, or paste Base64 and get the hex representation back. Everything runs locally in your browser using btoa() and atob() — nothing leaves your machine.
Encode mode (Hex → Base64) is the default. Toggle to Decode (Base64 → Hex) when you need to reverse the operation. Hex input can include spaces between bytes — they are stripped automatically.
How to Use This Tool
Choose Mode
Select Encode to convert hex bytes to Base64, or Decode to convert a Base64 string back to hex.
Paste Input
Paste your hex string (e.g., 48 65 6c 6c 6f) or Base64 string into the left editor. Use Sample to load a working example, or Upload to load from a file.
Copy or Download Result
The right panel updates instantly. Use Copy to grab the result, or Download to save it as a file.
Example
Encoding the hex bytes for "Hello, World!" to their Base64 representation:
Hex Input
Base64 Output
Frequently Asked Questions
How does hex to Base64 encoding work?
Each pair of hex digits represents one byte. The encoder reads the hex string two characters at a time, converts each pair to its byte value using parseInt(hex, 16), builds a binary string, then encodes it with the browser's btoa() function. The result follows the standard Base64 alphabet defined in RFC 4648.
Does the hex input need spaces between bytes?
No. You can paste hex with or without spaces — the tool strips all whitespace before processing. Both 48656c6c6f and 48 65 6c 6c 6f produce the same output. Colons (like in MAC addresses) are also stripped.
Can I paste a Data URI (data:...;base64,...) when decoding?
Yes. When decoding Base64 → Hex, the tool automatically strips the data: prefix and MIME type, so you can paste a full Data URI directly without editing it first.
Why does encoding fail with an odd-length hex string?
Each byte in hexadecimal requires exactly two characters. If your input has an odd number of hex characters, the last byte is incomplete and the encoder cannot proceed. Strip any 0x prefix, spaces, or colons, and make sure the total character count is even.
Is my data private?
Completely. All conversion happens inside your browser using JavaScript. Nothing is sent to any server. You can verify this in your browser's Network tab — there are no outbound requests while the tool is running.
What is the difference between Base64 and Base64url?
Standard Base64 uses +, /, and = padding. Base64url replaces + with - and / with _, making it safe to embed in URLs without percent-encoding. This tool produces standard Base64. For URL-safe variants use our Base64 URL Encoder.
Related Tools
The Base64 encoding scheme is defined in RFC 4648. Learn more about hexadecimal notation on Wikipedia. See also MDN: Base64.