ToolSphere

HTML Entities Encoder & Decoder

More tools

Encode text to HTML entities or decode entities to raw text. Supports named, decimal, and hex entity formats for special characters and non-ASCII symbols.

Scope:
Format:
Output result

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

How to use HTML Entities Encoder & Decoder

  1. 1Type or paste your text into the input field.
  2. 2Select either Encode or Decode mode.
  3. 3Choose the scope of encoding (Special characters, Non-ASCII, or All characters).
  4. 4Select entity format: Named (e.g. &), Decimal (e.g. &), or Hexadecimal (e.g. &).
  5. 5Copy or download the processed output instantly.

About HTML Entities Encoder & Decoder

What are HTML Entities?

HTML entities are character sequences used to represent characters that have special meanings in HTML or are outside the standard ASCII character set. For example, characters like < and > must be encoded as &lt; and &gt; respectively to prevent browsers from parsing them as HTML tags.

Using an encoder/decoder ensures code safety (preventing Cross-Site Scripting or XSS vulnerabilities) and preserves accurate character representations across all platforms and databases.

Key Encoding Features:

  1. Named Entities: Replaces characters with intuitive names defined by the HTML spec (e.g., &copy; for ©).
  2. Decimal Entities: Formats characters as their decimal code point values (e.g., &#169;).
  3. Hexadecimal Entities: Formats characters as their hex code point values (e.g., &#xa9;).

This tool runs entirely in your browser using local JavaScript, ensuring zero risk of server-side data snooping.

Guides and tutorials

Frequently asked questions

Why should I encode HTML entities?

Encoding is critical to display reserved HTML characters (like <, >, &, ") as raw text rather than interpreting them as active markup. It also helps secure forms against script injections.

What is the difference between Named and Hex formats?

Named entities use readable names (like &quot;) specified by the W3C. Hex/Decimal formats represent the same characters using their unicode code points (like &#x22;), which are supported by all XML/HTML parses.

Are my code samples safe?

Yes. Processing is done strictly inside your browser, meaning none of your code is transmitted to external servers.

Have a suggestion for HTML Entities Encoder & Decoder?Share your feedback ↗