---
title: Text.FromBinary – แปลง Binary เป็น Text
url: https://www.thepexcel.com/functions/power-query/text-functions/text-frombinary/
type: function-explainer
program: Power Query
syntax: "Text.FromBinary(binary as nullable binary, optional encoding as nullable number) as nullable text"
date: 2025-12-04
updated: 2025-12-17
scores:
  popularity: 5
  difficulty: 3
  usefulness: 5
---

# Text.FromBinary – แปลง Binary เป็น Text

> แปลงค่า Binary เป็นข้อความ

## คำอธิบาย

Text.FromBinary ใช้สำหรับแปลงค่า Binary เป็นข้อความ โดยใช้การเข้ารหัส UTF-8 เป็นค่าเริ่มต้น รองรับการเข้ารหัสอื่นๆ เช่น UTF-16 และ ASCII

## Syntax

```excel
Text.FromBinary(binary as nullable binary, optional encoding as nullable number) as nullable text
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| binary | Yes | nullable binary |  | ค่า Binary ที่ต้องการแปลงเป็นข้อความ |
| encoding | No | nullable number | BinaryEncoding.Utf8 | ประเภทการเข้ารหัส (ค่าเริ่มต้น UTF-8) |

## เคสการใช้งาน

### อ่านเนื้อหาไฟล์ข้อความจาก Binary

อ่านเนื้อหาไฟล์ข้อความจาก Binary

### ถอดรหัส Binary data ที่ได้จากแหล่งข้อมูลภายนอก

ถอดรหัส Binary data ที่ได้จากแหล่งข้อมูลภายนอก

### ประมวลผล Binary response จาก Web API

ประมวลผล Binary response จาก Web API

## ตัวอย่าง

### 1. แปลง Binary ธรรมชาติ

```excel
Text.FromBinary(#binary({72, 101, 108, 108, 111}))
```

**ผลลัพธ์:** `Hello`

แปลง bytes 72, 101, 108, 108, 111 เป็น 'Hello'

### 2. Round-trip conversion

```excel
Text.FromBinary(Text.ToBinary("Test"))
```

**ผลลัพธ์:** `Test`

แปลง Text → Binary → Text

### 3. อ่านไฟล์ข้อความ

```excel
Text.FromBinary(File.Contents("data.txt"))
```

**ผลลัพธ์:** `[เนื้อหาไฟล์]`

แปลงเนื้อหาไฟล์ Binary เป็นข้อความ

## ฟังก์ชันที่เกี่ยวข้อง

- [Text.ToBinary – แปลง Text เป็น Binary](https://www.thepexcel.com/functions/power-query/text-functions/text-tobinary/)
- [Text.From – แปลงค่าเป็นข้อความ](https://www.thepexcel.com/functions/power-query/text-functions/text-from/)
- [File.Contents – อ่านข้อมูลจากไฟล์](https://www.thepexcel.com/functions/power-query/accessing-data-functions/file-contents/)
- [Json.FromValue – แปลง Value เป็น JSON](https://www.thepexcel.com/functions/power-query/text-functions/json-fromvalue/)

## แหล่งข้อมูลเพิ่มเติม

- [Microsoft Learn: Text.FromBinary](https://learn.microsoft.com/en-us/powerquery-m/text-frombinary) _(Official Documentation)_

---

_Source: [https://www.thepexcel.com/functions/power-query/text-functions/text-frombinary/](https://www.thepexcel.com/functions/power-query/text-functions/text-frombinary/)_
