# Base64 to hex converter

**URL:** <https://community.glideapps.com/t/base64-to-hex-converter/65643>\
**Category:** Ask for Help\
**Created:** [August 31, 2023, 10:29pm UTC](https://community.glideapps.com/t/base64-to-hex-converter/65643 "2023-08-31T22:29:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mns\_Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mns_glide/32/2514_2.png) [@Mns\_Glide](https://community.glideapps.com/u/Mns_Glide)\
**Post date:** [August 31, 2023, 10:29pm UTC](https://community.glideapps.com/t/base64-to-hex-converter/65643/1 "2023-08-31T22:29:41Z")

</div>

Hi,

I have base64 data and I would like to convert it to Hex … Is it possible to use Decode Text under Computed - Experimental Column. If so, what do I put into Encoding/Decoding Column. I tried using Hex but it does not work. Appreciate feedback. Thank you.

![decode-edited](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/7/67e19244e25424c943a43f8cfd5077dd9b5f4d02.jpeg)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 1, 2023, 1:43am UTC](https://community.glideapps.com/t/base64-to-hex-converter/65643/2 "2023-09-01T01:43:57Z")

</div>

You can try this in a JavaScript column.

```auto
function base64ToHex(base64) {
  try {
    const raw = atob(base64);
    let hex = '';
    
    for (let i = 0; i < raw.length; i++) {
      const hexChar = raw.charCodeAt(i).toString(16);
      hex += (hexChar.length === 2 ? hexChar : '0' + hexChar);
    }
    
    return hex;
  } catch (err) {
    return '';
  }
}

return base64ToHex(p1)

```

Not sure if your example string is valid base64, but it returned an error for me.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/f/3f9882f50fc420476f8496b8e394bed7977900c6.png)

---

<div class="post-metadata">

**Author:** ![Mns\_Glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mns_glide/32/2514_2.png) [@Mns\_Glide](https://community.glideapps.com/u/Mns_Glide)\
**Post date:** [September 1, 2023, 1:54am UTC](https://community.glideapps.com/t/base64-to-hex-converter/65643/3 "2023-09-01T01:54:25Z")

</div>

Thanks Thinh … looks correct for me.
