HTML Entity Encoder and Decoder
Convert HTML special characters such as < and & to < and &, or decode references such as and س back to text.
Runs on your device.
& < > " ' are always encoded. The output is safe inside an element and inside a quoted attribute value.
How to Use It
- Choose Encode or Decode.
- Paste the text or the HTML.
- 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.