# Problem with base64/template

**URL:** <https://discourse.nodered.org/t/problem-with-base64-template/102325>\
**Category:** General\
**Created:** [4 December 2026 11:16 UTC](https://discourse.nodered.org/t/problem-with-base64-template/102325 "2026-12-04T11:16:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [4 December 2026 11:16 UTC](https://discourse.nodered.org/t/problem-with-base64-template/102325/1 "2026-12-04T11:16:18Z")

</div>

I'm trying to encode an MQTT message into JSON - the payload is a buffer converted to base24 and I'm using a template to add on some extra values but I'm getting an output like this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/e/8ececef3c1a17fe5a0141fbbaf08cfc2babda612.png)

where the data is obviously not proper base64.

My template looks like this - what am I doing wrong?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/2/7284562e3f2aa30512e225d1056beb72a8c77085.png)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [4 December 2026 11:20 UTC](https://discourse.nodered.org/t/problem-with-base64-template/102325/2 "2026-12-04T11:20:57Z")

</div>

I think you need to use 3 curly braces to avoid encoding by the template;

```auto
{{{payload}}}

```

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [4 December 2026 11:51 UTC](https://discourse.nodered.org/t/problem-with-base64-template/102325/3 "2026-12-04T11:51:15Z")

</div>

duh - obvious now you've said it 🙂  
Thank you 🙂
