Next-Gen App & Browser
Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles
This free tool instantly converts Base64-encoded data to hexadecimal. Simply paste your input, click convert, and get the Hex output.
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.
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.
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
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
}
}
Base64 | Hex |
---|---|
A | 0 |
B | 1 |
C | 2 |
D | 3 |
E | 4 |
F | 5 |
G | 6 |
H | 7 |
I | 8 |
J | 9 |
K | 0A |
L | 0B |
M | 0C |
N | 0D |
O | 0E |
P | 0F |
Q | 10 |
R | 11 |
S | 12 |
T | 13 |
U | 14 |
V | 15 |
W | 16 |
X | 17 |
Y | 18 |
Z | 19 |
a | 1A |
b | 1B |
c | 1C |
d | 1D |
e | 1E |
f | 1F |
g | 20 |
h | 21 |
i | 22 |
j | 23 |
k | 24 |
l | 25 |
m | 26 |
n | 27 |
o | 28 |
p | 29 |
q | 2A |
r | 2B |
s | 2C |
t | 2D |
u | 2E |
v | 2F |
w | 30 |
x | 31 |
y | 32 |
z | 33 |
0 | 34 |
1 | 35 |
2 | 36 |
3 | 37 |
4 | 38 |
5 | 39 |
6 | 3A |
7 | 3B |
8 | 3C |
9 | 3D |
+ | 3E |
/ | 3F |
= | Padding |
Yes, our tool is completely free with no hidden charges or subscriptions.
Yes, our converter supports large Base64 inputs and efficiently processes them.
Absolutely. We do not store or share any data entered in the tool.
Yes, our tool is fully responsive and works on desktops, tablets, and smartphones.
No installation is required. This tool works directly from your web browser.
Did you find this page helpful?