Next-Gen App & Browser
Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

Base64 to Hex

This free tool instantly converts Base64-encoded data to hexadecimal. Simply paste your input, click convert, and get the Hex output.

Test Your Web Or Mobile Apps On 3000+ Browsers
Signup for free...

Input

Output

What is Base64?

Base64 is an encoding scheme for binary data in ASCII string format. It’s commonly used for data transmission, cryptography, and embedding image data in web applications. This encoding helps ensure that data remains intact without modification during transport.

What is Hexadecimal (Hex)?

Hexadecimal is a base-16 numbering system that represents binary data in a human-readable format. It’s widely used in computing, programming, and cryptography. Since each hex digit represents four binary digits, it’s an efficient way to display binary data in a compact form.

Why Convert Base64 to Hex?

  • Easier Debugging: The hexadecimal format is more readable for developers than Base64.
  • Binary Data Representation: Hex is commonly used in networking, cryptography, and software development.
  • Encoding Compatibility: Some systems require data in Hex format rather than Base64.
  • Checksum Verification: Many cryptographic processes utilize Hex to verify integrity.

Understanding the Conversion Process

  • Base64 Encoding:
    • Base64 represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, and /).
    • Every three bytes (24 bits) of binary data are mapped to four Base64 characters.
    • Example: "Hello"SGVsbG8=
  • Base64 Decoding to Binary:
    • The Base64 string is decoded back into its original binary form (raw bytes).
  • Binary to Hexadecimal Conversion:
    • Each byte (8 bits) is converted into a two-character hexadecimal representation.
    • Example:
      • Binary: 01001000 (72 in decimal) → 0x48 in Hex
      • Binary: 01100101 (101 in decimal) → 0x65 in Hex

How to Convert Base64 to Hex?

  • Enter Base64 Data: Paste your Base64 string into the input field. Alternatively, load the data directly from its URL or upload a TXT file containing the Base64 data.
  • Choose Separator: Select your preferred format for the Hex output (space, comma, 0X separator, or none).
  • Conversion Process: The conversion happens in real time as you type. To convert manually, uncheck the auto-conversion option and click the “Convert” button to begin the process.
  • Copy/Download the Output: Copy the converted Hex data using the provided copy button. You can also download the output as a TXT file.
  • Reset or Modify: Click the reset button to clear all inputs and start a new conversion.

How to Covert Base64 to Hex in JavaScript?

You can convert a Base64 string to a Hex string in JavaScript using the following approach:

function base64ToHex(base64) {
    const binaryString = atob(base64); // Decode Base64 to binary string
    let hex = '';
    for (let i = 0; i < binaryString.length; i++) {
        hex += binaryString.charCodeAt(i).toString(16).padStart(2, '0'); // Convert each character to hex
    }
    return hex;
}

// Example usage
const base64Str = 'SGVsbG8gd29ybGQ='; // Base64 encoded "Hello world"
console.log(base64ToHex(base64Str)); // Output: 48656c6c6f20776f726c64

How to Covert Base64 to Hex in Java?

In Java, you can use the java.util.Base64 and String.format() to convert Base64 to Hex. Here’s an example:

import java.util.Base64;

public class Base64ToHex {
    public static String base64ToHex(String base64) {
        byte[] decodedBytes = Base64.getDecoder().decode(base64); // Decode Base64 to bytes
        StringBuilder hexString = new StringBuilder();
        for (byte b : decodedBytes) {
            hexString.append(String.format("%02x", b)); // Convert each byte to hex
        }
        return hexString.toString();
    }

    public static void main(String[] args) {
        String base64Str = "SGVsbG8gd29ybGQ="; // Base64 encoded "Hello world"
        System.out.println(base64ToHex(base64Str)); // Output: 48656c6c6f20776f726c64
    }
}

Why Convert Base64 to Hex?

  • Easier Debugging: The hexadecimal format is more readable for developers than Base64.
  • Binary Data Representation: Hex is commonly used in networking, cryptography, and software development.
  • Encoding Compatibility: Some systems require data in Hex format rather than Base64.
  • Checksum Verification: Many cryptographic processes utilize Hex to verify integrity.

Base64 to Hex Conversion Table

Base64Hex
A0
B1
C2
D3
E4
F5
G6
H7
I8
J9
K0A
L0B
M0C
N0D
O0E
P0F
Q10
R11
S12
T13
U14
V15
W16
X17
Y18
Z19
a1A
b1B
c1C
d1D
e1E
f1F
g20
h21
i22
j23
k24
l25
m26
n27
o28
p29
q2A
r2B
s2C
t2D
u2E
v2F
w30
x31
y32
z33
034
135
236
337
438
539
63A
73B
83C
93D
+3E
/3F
=Padding

Common Use Cases

  • Cryptography: Convert encoded keys and secure data formats.
  • Debugging & Development: Easily analyze encoded information in software development.
  • Networking & Security: Decode authentication tokens and encoded data for security purposes.
  • Forensics & Data Analysis: Transform encoded evidence for further examination.

Frequently Asked Questions (FAQs)

Is this Base64 to Hex converter free to use?

Yes, our tool is completely free with no hidden charges or subscriptions.

Can I convert large Base64 strings?

Yes, our converter supports large Base64 inputs and efficiently processes them.

Is my data secure?

Absolutely. We do not store or share any data entered in the tool.

Can I use this tool on mobile devices?

Yes, our tool is fully responsive and works on desktops, tablets, and smartphones.

Do I need to install any software?

No installation is required. This tool works directly from your web browser.

Did you find this page helpful?

Helpful

NotHelpful

More Tools

... Code Tidy
... Data Format
... Random Data
... Hash Calculators
... Utils
ShadowLT Logo

Start your journey with LambdaTest

Get 100 minutes of automation test minutes FREE!!

Signup for free