# Binary to JSON problem

**URL:** <https://community.n8n.io/t/binary-to-json-problem/30258>\
**Category:** Questions\
**Tags:** move-binary-data\
**Created:** [September 7, 2023, 7:46am UTC](https://community.n8n.io/t/binary-to-json-problem/30258 "2023-09-07T07:46:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jerome\_Blache](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jerome_blache/32/27387_2.png) [@Jerome\_Blache](https://community.n8n.io/u/Jerome_Blache)\
**Post date:** [September 7, 2023, 7:46am UTC](https://community.n8n.io/t/binary-to-json-problem/30258/1 "2023-09-07T07:46:27Z")

</div>

## Describe the problem/error/question

I try to convert some binary data in a json to readable data encoding in utf-8 in a new field.

## What is the error message (if any)?

## Please share your workflow

```auto
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

```

{  
“meta”: {  
“instanceId”: “3c306c4580d5053e06c89fde170880165a84bf6f23a8f85375e30a1b08e929f7”  
},  
“nodes”: [  
{  
“parameters”: {  
“setAllData”: false,  
“sourceKey”: “={{ $json.xml }}”,  
“options”: {  
“encoding”: “utf8”,  
“keepSource”: true  
}  
},  
“id”: “e93db011-a789-4fbb-8106-9e0564f3088a”,  
“name”: “Get junit file”,  
“type”: “n8n-nodes-base.moveBinaryData”,  
“typeVersion”: 1,  
“position”: [  
420,  
820  
],  
“alwaysOutputData”: true  
}  
],  
“connections”: {}  
}

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/7/e/7e1713bb351a940323ed759a8a5abd151f261ccb.png)

## Share the output returned by the last node

I expect to have some data in the output of my node but I don’t understand why there is nothing.  
Thank you for your help.

## Information on your n8n setup

- **n8n version:**
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![Gabriele\_Bracciali](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/gabriele_bracciali/32/31293_2.png) [@Gabriele\_Bracciali](https://community.n8n.io/u/Gabriele_Bracciali)\
**Post date:** [September 7, 2023, 11:39am UTC](https://community.n8n.io/t/binary-to-json-problem/30258/3 "2023-09-07T11:39:29Z")

</div>

Hi @Jerome_Blache I’ve created [this topic](http://community.n8n.io/t/convert-binary-file-to-json-or-csv/24593) about this few months ago.  
Maybe can help you?

---

<div class="post-metadata">

**Author:** ![MutedJam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mutedjam/32/70851_2.png) [@MutedJam](https://community.n8n.io/u/MutedJam)\
**Post date:** [September 7, 2023, 2:12pm UTC](https://community.n8n.io/t/binary-to-json-problem/30258/5 "2023-09-07T14:12:23Z")

</div>

Hi @Jerome_Blache, welcome to the community!

I am sorry you’re having trouble. In addition to what @Gabriele_Bracciali has shared it’d be great if you could share some example data you’re working with. If it’s a base64-encoded file you currently have (and you don’t want to write custom code) you could consider simply using two Move Binary Data nodes to convert this into a human readable string:

The first one would create a binary file based on what appears to be base64 data, the second one would read it as a string.

---

<div class="post-metadata">

**Author:** ![Jerome\_Blache](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jerome_blache/32/27387_2.png) [@Jerome\_Blache](https://community.n8n.io/u/Jerome_Blache)\
**Post date:** [September 7, 2023, 4:11pm UTC](https://community.n8n.io/t/binary-to-json-problem/30258/6 "2023-09-07T16:11:18Z")

</div>

> [@MutedJam](#):
>
> you could consider simply using two Move Binary Data nodes to convert this into a human readable string:

Thank you for your answer.

---

<div class="post-metadata">

**Author:** ![Jerome\_Blache](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jerome_blache/32/27387_2.png) [@Jerome\_Blache](https://community.n8n.io/u/Jerome_Blache)\
**Post date:** [September 7, 2023, 4:14pm UTC](https://community.n8n.io/t/binary-to-json-problem/30258/7 "2023-09-07T16:14:38Z")

</div>

Thank you, it’s working now. I was able to retrieve my XML data using this method. I wasn’t aware that my file was base64-encoded.

This was my first time posting a question in this community, and I’m pleasantly surprised by how quickly people responded. n8n is a fantastic tool, and I hope you’ll continue to provide support to users like me in the future.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [September 14, 2023, 4:14pm UTC](https://community.n8n.io/t/binary-to-json-problem/30258/8 "2023-09-14T16:14:59Z")

</div>

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