HTML Encoder & Decoder | Escape/Unescape Entities

EncodingRuns in Your Browser (No Uploads)
Loading…

Convert text to HTML entities (named or numeric) so it renders safely, or decode entities back to plain text. Ideal for XSS‑safe display and code samples; 100% local processing.

How to Use This Tool

  1. 1

    Choose Encode to escape HTML or Decode to restore characters.

  2. 2

    Paste or type text; results update instantly in Live mode (or click in Manual mode).

  3. 3

    Pick entity type: Named (©, €,  ) or Numeric (&#...;).

  4. 4

    Copy the result or use Swap to switch directions.

Use Cases & Examples

Preventing XSS in Rendered Content

Encode user‑generated text before output so browsers display it safely instead of executing it.

Showing Code Examples

Display HTML snippets in docs and posts as literal text (e.g., <div>...</div>).

Symbols & International Characters

Render ©, €, non‑breaking spaces, and other characters consistently across browsers and email clients.

HTML entities & safe rendering

Entities are escape sequences (start with & and end with ;) that render reserved or hard‑to‑type characters as text.

Encode <, >, & and quotes in attributes so markup isn't interpreted as code.

Named entities are human‑readable; numeric entities use Unicode code points and work for any character.

Frequently Asked Questions

Q.Is HTML encoding the same as encryption?

A. No. Encoding changes how text renders in HTML; it doesn't provide secrecy or transport security.

Q.Named vs. numeric entities — what’s the difference?

A. Named entities use names (&copy;); numeric entities use code points (&#169;) and cover any Unicode character.

Q.Which characters must be encoded?

A. Encode <, >, and & in HTML; encode quotes inside attribute values for correctness and safety.

Q.Does encoding alone prevent XSS?

A. It's necessary for safe rendering but should be combined with validation and a Content Security Policy (CSP).

Related Tools

Explore more developer tools

Browse All Tools