T

HTML Entity Codec

Online HTML Entity Encoder and Decoder

HTML Entity Codec Description

Encode or decode HTML entities in your text. This tool converts special characters into their HTML entity equivalents and vice versa.

How to use

  1. Enter the text containing HTML entities or special characters.
  2. Choose 'Encode' to convert characters to entities (e.g., < to &lt;).
  3. Choose 'Decode' to convert entities back to plain text.

Common Scenarios

  • Displaying code snippets on web pages without triggering HTML parsing.
  • Preventing Cross-Site Scripting (XSS) by escaping user input.
  • Handling special symbols or non-ASCII characters in HTML source code.

Data Structure

HTML entities can be named (like &copy;) or numeric (like &#169;). They always start with & and end with ;.

Principles

Encoding replaces reserved HTML characters with their corresponding entity strings. Decoding parses these sequences and returns the original character.