# How to decode the base64 data from LoRaWan gateway F8926-GW?

**URL:** https://discourse.nodered.org/t/how-to-decode-the-base64-data-from-lorawan-gateway-f8926-gw/100638
**Category:** General
**Created:** [24 March 2026 02:36 UTC](https://discourse.nodered.org/t/how-to-decode-the-base64-data-from-lorawan-gateway-f8926-gw/100638 "2026-03-24T02:36:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Champion](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@Champion](https://discourse.nodered.org/u/Champion)
#### Post date: [24 March 2026 02:36 UTC](https://discourse.nodered.org/t/how-to-decode-the-base64-data-from-lorawan-gateway-f8926-gw/100638/1 "2026-03-24T02:36:19Z")

</div>

Hi, I am establishing a project using F8926-GW LoRaWan Gateway to transmit the data to IPC. The LoRaWan gateway is transmitting base64 data, how am I going to decode the base64 data by using Node Red?

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

---

<div class="post-metadata">

### Author: ![rxraine](https://avatars.discourse-cdn.com/v4/letter/r/87869e/32.png) [@rxraine](https://discourse.nodered.org/u/rxraine)
#### Post date: [24 March 2026 08:04 UTC](https://discourse.nodered.org/t/how-to-decode-the-base64-data-from-lorawan-gateway-f8926-gw/100638/2 "2026-03-24T08:04:23Z")

</div>

Give this a try:

```auto
// 1. Check if the payload exists and is a string
if (typeof msg.payload === 'string') {
    
    // 2. Convert the base64 string into a Node.js Buffer
    let decodedBuffer = Buffer.from(msg.payload, 'base64');
    
    // 3. Convert the Buffer into a standard UTF-8 string
    msg.payload = decodedBuffer.toString('utf8');
}

return msg;

```

Returns "abcd" from your example.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [22 June 2026 08:04 UTC](https://discourse.nodered.org/t/how-to-decode-the-base64-data-from-lorawan-gateway-f8926-gw/100638/3 "2026-06-22T08:04:37Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
