HTML Entity Encoder/Decoder

Encode special characters into HTML entities, or decode entities back into readable text.

Loading tool…

How to use the HTML Entity Converter

  1. Paste plain text or HTML into the input box.
  2. Click "Encode" to convert characters like <, >, &, and quotes into their safe HTML entity equivalents.
  3. Or switch to "Decode" to convert HTML entities back into their original characters.

Why use this tool

Characters like < and & have special meaning in HTML, so displaying them as literal text (rather than having the browser interpret them as markup) requires encoding them as entities. This is essential when showing user-submitted text or code snippets safely inside a web page.

Frequently Asked Questions

Why would I need to encode text like this?

If you display raw user input or code samples directly inside HTML without encoding, characters like < and > can be misinterpreted as tags, breaking the page layout or, in the case of unencoded user input, creating an XSS vulnerability.

Does this tool sanitize input for security purposes?

It performs standard HTML entity encoding of the core special characters, which is one part of preventing XSS, but a full security review of how user input is handled requires more than just this tool.