# Cannot convert base64 to buffer

**URL:** <https://discourse.nodered.org/t/cannot-convert-base64-to-buffer/17083>\
**Category:** General\
**Created:** [24 October 2019 12:40 UTC](https://discourse.nodered.org/t/cannot-convert-base64-to-buffer/17083 "2019-10-24T12:40:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![YT2310](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/yt2310/32/35255_2.png) [@YT2310](https://discourse.nodered.org/u/YT2310)\
**Post date:** [24 October 2019 12:40 UTC](https://discourse.nodered.org/t/cannot-convert-base64-to-buffer/17083/1 "2019-10-24T12:40:56Z")

</div>

Hey there,

I try to convert a base64 encoded picture to buffer but it does not work. I have no idea why it does not work..

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d77d3c09e4910dee9d359f2e7265fca93930d8f0.png)

normally the second debug should be a buffer?

Or am I just to stupid at the moment?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [24 October 2019 12:51 UTC](https://discourse.nodered.org/t/cannot-convert-base64-to-buffer/17083/2 "2019-10-24T12:51:04Z")

</div>

Hi @YT2310

The base64 node expects `msg.payload` to contain a base64 encoded string.

The first debug message shows what you actually have is a JSON string representation of an Array containing a base64 string.

If you replace the JSON node with the Change node configured to set `msg.payload` to the value of `msg.payload[0]`, then you will be passing your base64 string to the base64 node as required.
