Hash to Hexadecimal / Base64 Converter
Convert hash values between hex and Base64 formats. If you have a hash in one format but need it in another, this tool does the conversion instantly.
Hash Format Conversion
Hashes can be represented in different formats. Hexadecimal uses 2 characters per byte (0-9, a-f), while Base64 uses ~1.33 characters per byte (A-Z, a-z, 0-9, +, /).
Different systems prefer different formats. For example, web APIs often use Base64, while blockchain applications typically use hexadecimal.
How Hash Format Conversion Works
Hashes are just bytes—binary data that can be represented in different text formats. This tool automatically detects whether you've pasted a hexadecimal or Base64 encoded hash and converts it to the other format.
Hexadecimal uses 2 characters per byte (0-9 and a-f), while Base64 uses about 1.33 characters per byte (A-Z, a-z, 0-9, +, /, with = padding). The underlying binary data is identical—only the text representation changes.
The conversion process:
- Input is analyzed to detect format (hex uses only 0-9a-f, Base64 uses A-Za-z0-9+/=)
- For hex input: pairs of characters are converted to bytes, then encoded as Base64
- For Base64 input: decoded to bytes, then each byte becomes two hex characters
- Output is displayed in both formats for comparison
Example: The MD5 hash of "hello" is5d41402abc4b2a76b9719d911017c592 in hex, which becomesXUFAKrxLKna5cZ2REYfFkg== in Base64. Same 16 bytes, different text representation.
When You'd Actually Use This
Working with web APIs
Some APIs return hashes in Base64 (common in JavaScript/Node.js), while others use hex (common in blockchain and security tools). Convert between formats to match what your code expects.
Comparing hashes across systems
Your database stores SHA-256 hashes in hex, but the verification library outputs Base64. Convert one format to confirm they match without manual character-by-character comparison.
Blockchain and cryptocurrency development
Bitcoin and Ethereum typically use hex for hashes, but some RPC APIs return Base64. Convert transaction hashes, block hashes, or public keys between formats as needed.
Debugging cryptographic code
Your hash output doesn't match expected values? Convert to the same format as your test vectors to verify correctness. Different libraries default to different encodings.
Working with JWT tokens
JWT signatures and some claims use Base64URL encoding (a Base64 variant). Convert to hex for analysis or to match documentation examples that use hexadecimal.
Database storage optimization
Storing hashes in a database? Base64 is about 25% more compact than hex (22 chars vs 32 for 128-bit hashes). Convert to calculate storage requirements or migrate existing data.
What to Know Before Converting Hash Formats
The hash doesn't change—only the encoding. A SHA-256 hash is still SHA-256 whether it's displayed as hex or Base64. The underlying 32 bytes are identical.
Input must be valid. Hex input must have an even number of characters (each byte needs 2 hex digits). Base64 must have valid padding. Invalid input won't convert.
Base64URL is different from Base64. Some systems (like JWT) use Base64URL encoding, which replaces + with - and / with _. This tool handles standard Base64. For Base64URL, you may need to adjust characters first.
Padding matters in Base64. Base64 strings often end with = or == padding characters. These are part of the encoding and should be included when converting.
Size comparison: For a 256-bit (32-byte) hash: hex = 64 characters, Base64 = 44 characters (including padding). Base64 saves about 31% in text length.
Common Questions
Why are there two formats for the same hash?
Hashes are binary data, but we need text representations for display and storage. Hex is human-readable and universal. Base64 is more compact and common in web protocols. Different communities standardized on different formats.
Which format should I use for storage?
For databases: Base64 saves space (25% smaller than hex). For logs and debugging: hex is easier to read and search. For URLs: consider Base64URL (URL-safe Base64). For blockchain: hex is the convention. Match your ecosystem's standards.
Can I convert any hash between formats?
Yes, as long as it's a raw hash value. MD5, SHA-1, SHA-256, SHA-512, and any other hash can be converted. The algorithm doesn't matter—only the underlying bytes.
What's the difference between Base64 and Base64URL?
Base64URL replaces + with - and / with _ to make it URL-safe (no encoding needed in URLs). It also typically omits padding. Convert Base64 to Base64URL by replacing those characters and removing = padding.
Why does my Base64 output have = at the end?
Base64 encodes 3 bytes into 4 characters. If the input isn't divisible by 3, padding characters (=) are added. One = means 2 bytes in the final group; two = means 1 byte. It's part of the standard.
How do I verify the conversion is correct?
Convert hex to Base64, then convert that Base64 back to hex. You should get your original input. This tool shows both outputs simultaneously, making verification easy.
Does this work for encoded data, not just hashes?
Yes. Any binary data encoded as hex or Base64 can be converted between formats. This includes images, files, encryption keys, signatures—anything represented as encoded bytes.
Other Free Tools
MD5 Hash Generator & Checker
MD5 Hash Generator & Checker
SHA-256 Hash Generator
SHA-256 Hash Generator
SHA-1 Hash Generator & Decrypter
SHA-1 Hash Generator & Decrypter
SHA-512 Hash Calculator
SHA-512 Hash Calculator
SHA-3 Hash Generator (Keccak)
SHA-3 Hash Generator (Keccak)
ASCII to Hex Converter
ASCII to Hex Converter: Text to Hexadecimal Translator
Barcode Generator
Free Barcode Generator
Binary to Text Converter
Binary to Text Converter
Free Printable Calendar Maker
Create & Print Your Custom Calendar
Pie Chart Maker
Free Pie Chart Maker Online