Monu Tools

เข้ารหัส/ถอดรหัส HTML Entity

เข้ารหัสข้อความเป็น HTML entities หรือถอดรหัส entities กลับเป็นข้อความ ปลอดภัยกับ UTF-8 และทำงานฝั่งไคลเอนต์

วิธีใช้ HTML Encoder

  1. 01

    วางข้อความหรือ HTML ของคุณ

  2. 02

    เลือก Encode (escape ตัวพิเศษ HTML), Encode all (รวมถึง escape ตัวอักษรที่ไม่ใช่ ASCII) หรือ Decode

  3. 03

    คัดลอกผลลัพธ์

What it does

An HTML entity encoder and decoder for escaping special characters so they display as text instead of being interpreted as markup. It converts characters like < and & into entities such as &lt; and &amp;, and decodes them back again.

Encoding and decoding are UTF-8 safe and run entirely in your browser, so nothing you paste is uploaded.

How encoding works

Encoding always escapes the five characters that have special meaning in HTML: & < > " and '. That is what stops a stray < from being read as the start of a tag, or text from accidentally breaking out of an attribute.

An Encode all option additionally turns every non-ASCII character into a numeric entity, which is useful for legacy systems, some email pipelines, or anywhere you need to be sure the output is pure ASCII.

What decoding understands

Decoding understands all three entity forms: named entities like &amp; and &copy;, decimal entities like &#233;, and hexadecimal entities like &#x20AC;. Sequences it does not recognize are left untouched rather than mangled.

Encoding and XSS

Escaping the HTML specials is the core defense against HTML injection and cross-site scripting (XSS): any untrusted text should be encoded before it is placed into a page, so it renders as harmless characters instead of active markup.

คำถามที่พบบ่อย

ความแตกต่างระหว่าง Encode และ Encode all คืออะไร?

Encode escape เฉพาะห้าอักขระที่ต้อง escape ใน HTML (& < > " ') Encode all ยังแปลงทุกอักขระที่ไม่ใช่ ASCII เป็น numeric entity ด้วย ซึ่งมีประโยชน์สำหรับระบบเดิมหรืออีเมล

ถอดรหัส entities ใดได้บ้าง?

Named entities เช่น &amp; และ &copy;, decimal entities เช่น &#233;, และ hexadecimal entities เช่น &#x20AC; ลำดับที่ไม่รู้จักจะไม่เปลี่ยนแปลง

ป้องกัน XSS ได้ไหม?

การเข้ารหัสตัวพิเศษ HTML เป็นการป้องกันหลักต่อการแทรก markup ควร encode ข้อความที่ไม่น่าเชื่อถือเสมอก่อนวางใน HTML

แหล่งข้อมูล

ฝังเครื่องมือนี้

เพิ่มเครื่องมือนี้ลงในเว็บไซต์ของคุณเอง คัดลอกสคริปต์ด้านล่าง โดยจะอัปเดตให้เป็นปัจจุบันโดยอัตโนมัติ

<iframe src="https://monu.tools/embed/th/html-encoder" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

เครื่องมือที่เกี่ยวข้อง