HTML Entity Encoder & Decoder

Prepare text for safe HTML display or decode entity references back to readable text.

How to use

These are example steps; replace the values for your task.

  1. Choose Encode and enter é in the source field.
  2. Enable numeric references for non-ASCII characters and inspect the result.
  3. Paste é into the source field and choose Decode to restore é.

Conversion settings

Original text

0 characters

Not saved

Converted text

0 characters

0 characters

About this tool

Safely display reserved characters in HTML source, code samples, CMS fields, and more.

Continue this task

Represent HTML-significant punctuation as text

With quote encoding enabled, “Tom & "Sam"” becomes “Tom & "Sam"”. Decoding that entity string returns the original text.

Try a use case and check the result

Convert HTML special characters to entity references for literal display.

Try this example replaces the input and settings. Restore previous input returns to the state before the latest example. Normal draft-saving rules apply.

After trying multiple examples, repeat Restore previous input to return to your original input. History is kept only in this page; restore any input you need before closing it.

Represent angle brackets and an ampersand

Input and settings

<b>A&B</b>

Encode quotes: On; Encode non-ASCII: Off; Operation: Encode

Expected result

&lt;b&gt;A&amp;B&lt;/b&gt;

How to read the result

The result represents the markup as text when inserted into HTML text content.

Scope and pitfalls

This does not guarantee safety in JavaScript, CSS, URLs or every attribute context; use context-appropriate handling.

Continue with the next task

Frequently asked questions

Which characters are always encoded?

Encoding always converts &, <, and >. Quotes and non-ASCII characters are optional.

What happens to invalid entities when decoding?

Recognized entities are decoded, while unrecognized text remains unchanged.

Is my text sent to a server?

No. Conversion and storage take place only in your browser.

Related tools

Inputs and storage

Keep a separate copy before clearing or resetting. This browser autosaves entered text and tool settings. Data is not restored when read 30 days or more after its last save. Clearing site data or storage restrictions may remove it sooner.

Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.

Explore tools & games

All 120 tools · 16 games

All 120 tools · 16 games

Text & writing 26

Calculators & converters 22

Date & time 12

Images & PDF 26

Data & web 28

Random & handy 6

Games 16