Base64 to Hex
The “Base64 to Hex” converter is a free tool which is able to convert online Base64 strings to Hex values. The conversion process is quite simple: the converter decodes the Base64 into the original data, then encodes it to Hex value and gives you the final result almost instantly. If you are looking for the reverse process, check Hex to Base64.
Comments (41)
I hope you enjoy this discussion. In any case, I ask you to join it.
Can I to have got code of fecode base64 to hex in javascript.
Thank you
function base64ToHex(str) {
const raw = atob(str);
let result = '';
for (let i = 0; i < raw.length; i++) {
const hex = raw.charCodeAt(i).toString(16);
result += (hex.length === 2 ? hex : '0' + hex);
}
return result.toUpperCase();
}
console.log(base64ToHex("oAAABTUAAg=="));
found it on stackoverflow
Thanks for the code. I would like to implement this in a google sheet. We are forwarding data in hex format that is base64 encoded from the Things Networks to Pipedream and then into google sheets. How would I add your code to the script editor in google sheets to decode our data?
Any help would be much appreciated.
Thanks!
To use the base64ToHex function in Google Sheets, you can create a custom function by following these steps:
Open your Google Sheets document and go to Tools > Script editor.
In the Script Editor, create a new function called base64ToHex and paste the code you provided:
python
Copy code
function base64ToHex(str) {
const raw = atob(str);
let result = '';
for (let i = 0; i < raw.length; i++) {
const hex = raw.charCodeAt(i).toString(16);
result += (hex.length === 2 ? hex : '0' + hex);
}
return result.toUpperCase();
}
Save the script and close the Script Editor.
In your Google Sheets document, select the cell where you want to display the hex value of a base64 string.
In the formula bar, type =base64ToHex("oAAABTUAAg==") and press Enter.
This should display the hex value of the base64 string "oAAABTUAAg==" in the selected cell. You can replace this value with a reference to a cell that contains a base64 string to decode it to hex format.
I hope this helps! Let me know if you have any further questions.
i need help with procedure to transform 'Helo' into 'yc2LYupgdVRzUcJYs6+/Lw=='
Thanks
if input == 'Helo':
print('yc2LYupgdVRzUcJYs6+/Lw==')
function heloToString(helo) {
if (helo === ‘helo’) {
return 'yc2LYupgdVRzUcJYs6+/Lw==';
} else {
return helo;
}
console.log(heloToString);
replace
console.log(heloToString);
to
console.log(heloToString("helo"));
Could you please provide me the conversion from base64 string to hex in C? (i.e in hex[0],hex[1], hex[2],...)
Thank you
This page is so helpful, but I have a problem with in base64 to hex.
Could you provide code from base64 to hex in C,please?
Thank you!
Debo responder un requerimiento, que consiste en convertir un código de Base64 a Hexadecimal, pero codificar dicha conversión en un programa RPG o RPG ILE.
Sera que ya alguien lo tiene ?
I've a question: Why this hex converter has different result from linux hexdump command?
here my command:
echo 'CIAO' | xxd -p
here the result:
4349414f0a
here the convert from this site:
08800e
CIAO
from Base64, then encodes result to Hex.no injury [72.13.216.248]
For some reason, the program throws an error of "Cannot decode the string. Most likely it’s not Base64 value or it contains invalid data."
Can anyone help me out?
سلام چجوری میتونم اینو رمزگشایی کنم سکرت ۳۲ رقمی بده؟
const raw = atob(str);
let result = '';
for (let i = 0; i < raw.length; i++) {
const hex = raw.charCodeAt(i).toString(16);
result += (hex.length === 2 ? hex : '0' + hex);
}
return result.toUpperCase();
}
console.log(base64ToHex("oAAABTUAAg=="))