Base64 to Hex






Reverse Conversion Tool: Hex to Base64 Converter

base64 to hex

What Is a Base64 to Hex Converter?

A Base64 to Hex Converter is a simple yet powerful tool that translates Base64-encoded strings into hexadecimal (base-16) format. This is especially useful for developers, cybersecurity experts, and systems engineers who work with encoded data in applications, APIs, and digital communications.

For example, converting SGVsbG8= (Base64) yields 48656C6C6F (Hex).


How Does Base64 to Hex Conversion Work?

base64 to hex conversion infographic

The conversion process involves two core steps:

  1. Decode Base64 to Binary: The Base64 string is decoded into raw binary data.
  2. Convert Binary to Hex: That binary data is then represented as hexadecimal pairs (00–FF range).

This conversion maintains the integrity of the original data and is ideal for cross-system communication where hex values are required.

Base64 to Hex Conversion Example

Let’s walk through converting the Base64 string SGVsbG8= to its hexadecimal representation:

πŸ“Œ Step 1: Understand the Base64 Input

The input SGVsbG8= is a Base64-encoded version of the ASCII string “Hello”.

πŸ“Œ Step 2: Decode Base64 to Binary (ASCII)

Decode the Base64 string SGVsbG8= to its original binary (text) form:

SGVsbG8=  β†’  Hello

Each character in “Hello” has a corresponding ASCII byte:

H β†’ 72
e β†’ 101
l β†’ 108
l β†’ 108
o β†’ 111

πŸ“Œ Step 3: Convert ASCII to Hexadecimal

Now convert each ASCII value to hex:

H (72)   β†’  48  
e (101) β†’ 65
l (108) β†’ 6C
l (108) β†’ 6C
o (111) β†’ 6F

βœ… Final Hex Output

Combine the hex values:

Hello β†’ 48 65 6C 6C 6F β†’ **48656C6C6F**

So, the Base64 input SGVsbG8= becomes:

πŸ”· Hexadecimal Output: 48656C6C6F

Convert Base64 to Hex in Code

▢️ Using JavaScript

Buffer.from("SGVsbG8=", "base64").toString("hex"); // "48656c6c6f"

🐍 Using Python

import base64, binascii
binascii.hexlify(base64.b64decode("SGVsbG8=")).decode('utf-8') # "48656c6c6f"

Base64 to Hex Conversion Table Examples

Base64 InputHex Output
SGVsbG8=48656C6C6F
V29ybGQ=576F726C64
MTIzNDU2313233343536

These examples show how ASCII strings (e.g., “Hello”, “World”) are first Base64 encoded and then decoded to hex values.


Why Convert Base64 to Hexadecimal?

There are several use cases for converting Base64 to Hex:

  • πŸ” Cryptographic operations (hashes like SHA256 or HMAC often appear in hex)
  • πŸ§ͺ Binary inspection in network packets or encoded strings
  • βš™οΈ Data serialization for APIs, IoT protocols, and embedded systems
  • 🧰 Debugging purposes in JavaScript, Python, or Linux-based applications

Need the reverse? Use our Hex to Base64 Converter to encode hexadecimal into Base64.


Supported Use Cases Base64 to Hex Converter

This converter works seamlessly with:

  • βœ… Base64 hashes from JWT or OAuth tokens
  • βœ… Binary files encoded for web use
  • βœ… Command-line tools like base64 (Linux) and certutil (Windows)
  • βœ… Programming languages like:
    • JavaScript: Buffer.from(base64, 'base64').toString('hex')
    • Python: binascii.hexlify(base64.b64decode(data))
    • Java: DatatypeConverter.parseBase64Binary(base64)

Online Base64 to Hex Converter Features

Our tool provides:

  • πŸš€ Instant conversion with no installation
  • πŸ”„ One-click switch for Hex to Base64 conversion
  • πŸ“‹ Easy copy and reset buttons
  • πŸ” 100% client-side (no data is sent to a server)

Related Tools You Might Need

Also visit our website for a collection of hex conversion and calculator tools.


FAQs – Base64 to Hex

Q1. Can I use Base64 to Hex for encrypted data?

Yes, it’s commonly used in cryptographic tools to interpret encoded hashes or digital signatures.

Q2. Is there a limit to the size of the Base64 string?

Most browsers support large strings, but for very large files, consider using command-line tools.

Q3. What’s the difference between Hex and Base64?

Hex uses 16 characters (0–9, A–F), Base64 uses 64 characters. Base64 is more compact but less readable than Hex.