Skip to main content
HandyWeb

HTML Entity Encoder and Decoder

Convert HTML special characters such as < and & to &lt; and &amp;, or decode references such as &nbsp; and &#1587; back to text.

Runs on your device.

Operation

& < > " ' are always encoded. The output is safe inside an element and inside a quoted attribute value.

0 characters0 bytes
0 characters0 bytes

How to Use It

  1. Choose Encode or Decode.
  2. Paste the text or the HTML.
  3. Copy the output.

Questions and Answers

Which characters are encoded?

Always & < > " and '. Persian letters and emoji stay, because a UTF-8 page does not need them encoded. If a system accepts only ASCII, turn on the non-ASCII option.

Which references does the decoder know?

All 2,231 named references of the HTML standard, and decimal and hex numbers. The decoder uses the HTML parser of your browser, so the result is what a browser shows on a page.

Is it safe to decode untrusted HTML here?

Yes. The input is read as text only: no script runs, and no image or other file loads.

Good to Know

Encoding makes text safe inside an element and inside a quoted attribute value, not inside <script>, <style>, or a URL. Decoding does not remove tags.

Source code of this toolReport a problem on GitHub