T

Text Machine

Powerful text tools, in your browser

HTML Encoder / Decoder

Encode text to HTML entities or decode HTML entities back to text.

Input Text

How to use HTML Encoder / Decoder

  1. 1

    Enter your text or HTML

    Paste plain text you want to escape, or HTML entities you want to convert back, into the input box.

  2. 2

    Choose encode or decode

    Click Encode to HTML Entities to convert characters like < > & into safe entities, or Decode HTML Entities to turn entities back into readable characters.

  3. 3

    Review the output

    Check the converted result in the output box, and use Swap Input/Output to chain a reverse conversion if needed.

  4. 4

    Copy the result

    Press Copy Output to grab the encoded or decoded text, or Clear Both to reset the fields.

Frequently asked questions

What characters get encoded into HTML entities?
Reserved and special characters such as < (&lt;), > (&gt;), & (&amp;), and quotation marks are replaced with their named or numeric HTML entities. This lets you display the characters literally on a page instead of having the browser interpret them as markup.
How does encoding help prevent XSS?
By converting characters like < and > into entities, any user-supplied markup or script tags are rendered as visible text rather than executed. Encoding untrusted input before inserting it into a page is a core defense against cross-site scripting (XSS).
Can I convert entities back to normal text?
Yes. The Decode HTML Entities button reverses the process, turning entities such as &amp; and &#39; back into the original & and ' characters so you can read or reuse the raw text.
What is the Swap button for?
Swap Input/Output moves your current result into the input field, which is convenient for round-tripping content, for example decoding a snippet and then re-encoding the edited version without retyping it.
Is my input sent to a server?
No. Encoding and decoding run entirely in your browser, so your text and any sensitive HTML never leave your device. The tool is free and requires no sign-up.

Related tools

Keep going with these handy tools

URL Encoder / Decoder

Base64 Encode / Decode

HTML to Text Converter

JSON Formatter

Regex Tester

JWT Decoder