# Base64 Decode helper

**URL:** <https://forums.losant.com/t/base64-decode-helper/5276>\
**Category:** Help\
**Tags:** workflow\
**Created:** [September 26, 2023, 2:08pm UTC](https://forums.losant.com/t/base64-decode-helper/5276 "2023-09-26T14:08:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stewart\_McCallum](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/stewart_mccallum/32/2490_2.png) [@Stewart\_McCallum](https://forums.losant.com/u/Stewart_McCallum)\
**Post date:** [September 26, 2023, 2:08pm UTC](https://forums.losant.com/t/base64-decode-helper/5276/1 "2023-09-26T14:08:49Z")

</div>

I’ve been trying to use the {{decodeBase64}} helper. The payload data:  
“8H9PZcLWUE1BR0MwNDIzRgAAAAAAGwAB” converts to : \uFFFD\u007FOe\uFFFD\uFFFDPMAGC0423F\u0000\u0000\u0000\u0000\u0000\u001B\u0000\u0001

While an online base64 decoder outputs this:  
F0 7F 4F 65 C2 D6 50 4D 41 47 43 30 34 32 33 46 00 00 00 00 00 1B 00 01  
Any insight appreciated,  
Stewart

---

<div class="post-metadata">

**Author:** ![Sebastian\_Turner](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/sebastian_turner/32/4024_2.png) [@Sebastian\_Turner](https://forums.losant.com/u/Sebastian_Turner)\
**Post date:** [September 26, 2023, 3:38pm UTC](https://forums.losant.com/t/base64-decode-helper/5276/2 "2023-09-26T15:38:42Z")

</div>

Hi @Stewart_McCallum ,

Our [`{{decodeBase64}}` helper](https://docs.losant.com/workflows/accessing-payload-data/#decodebase64-val) returns a decoded string in [UTF-8](https://developer.mozilla.org/en-US/docs/Glossary/UTF-8) character set. It looks like the online decoder you’re using is decoding it as hex.

We’ll look into adding an additional argument to the `{{decodeBase64}}` helper to specify the formatting. In the meantime, if you’re doing this in a workflow, you can use a [Function Node](https://docs.losant.com/workflows/logic/function/) to decode to hex. A simple example, which references `data.value` on the payload and stores the hex value as `working.newValue` :

```auto
const buffer = Buffer.from(payload.data.value, 'base64');
payload.working.newValue = buffer.toString('hex');

```

Thanks for the feedback, and please let us know if you have any other questions.

---

<div class="post-metadata">

**Author:** ![Stewart\_McCallum](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/stewart_mccallum/32/2490_2.png) [@Stewart\_McCallum](https://forums.losant.com/u/Stewart_McCallum)\
**Post date:** [September 26, 2023, 5:22pm UTC](https://forums.losant.com/t/base64-decode-helper/5276/3 "2023-09-26T17:22:49Z")

</div>

Excellent, thank you!
