HTML Entity Encoder / Decoder

编码/解码HTML实体。
结果

Encode & Decode

Special characters or all characters (&#NNN;).

Two Modes

Special chars only or full numeric encoding.

Copy Result

One-click copy to clipboard.

Client-side

All processing in your browser. No data uploaded.

关于HTML Entity Encoder / Decoder

The HTML Entity Encoder/Decoder is an essential tool for web developers and content editors who need to safely embed special characters in HTML documents. HTML reserves certain characters — such as <, >, &, and " — for its own syntax, so using them raw in content can break page structure or create security vulnerabilities like Cross-Site Scripting (XSS). This tool converts those characters to their safe HTML entity equivalents (e.g., & becomes &) in encode mode, or reverses the process in decode mode. There is also a "Encode All" mode that converts every character to its numeric entity form (&#NNN;), which is useful for obfuscating email addresses or ensuring maximum compatibility across character sets. All processing happens entirely in your browser using the browser's own DOM — no data is ever sent to a server, keeping your content private.

如何使用HTML Entity Encoder / Decoder

  1. Select Encode or Decode mode using the toggle at the top of the tool.
  2. In Encode mode, choose between "Special chars only" (converts &, <, >, ", ') or "All characters" (converts every character to a numeric &#NNN; entity).
  3. Paste or type your text into the input textarea.
  4. The encoded or decoded result appears instantly in the output area below.
  5. Click the Copy button next to the result to copy the output to your clipboard.
  6. Paste the result into your HTML file, template engine, or CMS editor.

常见问题

What is an HTML entity?

An HTML entity is a special text sequence that represents a character in HTML. It starts with & and ends with ;. For example, &amp;lt; displays as < without being interpreted as an HTML tag. Entities are used to display reserved characters and symbols that have special meaning in HTML.

Why do I need to encode HTML entities?

If you include raw < or > characters inside HTML content, the browser may interpret them as tag delimiters and break your page structure. Encoding them as &amp;lt; and &amp;gt; tells the browser to display the character visually rather than parse it as markup. This is also important for preventing XSS attacks in user-generated content.

What is the difference between "Special chars only" and "All characters" modes?

"Special chars only" encodes the five HTML-reserved characters: &, <, >, ", and '. "All characters" encodes every character as a numeric decimal entity like &#65; for the letter A. The latter is useful for obfuscation or ensuring compatibility with non-UTF-8 environments.

Is my data sent to a server?

No. All encoding and decoding is performed entirely in your browser. Your text never leaves your device. This makes the tool safe to use with sensitive or proprietary content.

Can I decode encoded email addresses?

Yes. If someone has encoded an email address using numeric entities to hide it from spam scrapers, you can paste it into the decoder to reveal the plain text version.

相关工具

HTML FormatterBase64 Encoder/DecoderMarkdown to HTMLText DiffWord Counter
Free Ebook
Top 10 Free Tools Every Developer Needs

Top 10 Free Tools Every Developer Needs

Boost your productivity instantly. Get our exclusive cheatsheet featuring the most essential web utilities you didn't know you needed, delivered straight to your inbox.

We respect your inbox. Unsubscribe at any time.