Skip to content

HTML Entity Encoder & Decoder

What the HTML Entity Encoder & Decoder does

This tool converts special characters (like <, >, &, and accented letters) into their HTML entity equivalents, or decodes HTML entities back into readable characters — necessary any time raw text needs to display safely inside HTML.

How to use it

  1. Paste your text or HTML-encoded string into the box.
  2. Click Encode Entities or Decode Entities depending on direction.
  3. Click Copy result to copy the output.

Common uses

  • Encoding user-submitted text before displaying it safely on a webpage.
  • Decoding an entity-encoded string pulled from an RSS feed or API response.
  • Preparing text containing angle brackets or ampersands for embedding in HTML.
  • Debugging a webpage that's displaying &amp; instead of an ampersand.
  • Converting copy-pasted text with special punctuation into safe HTML output.

Good to know

Encoding characters like < and > before inserting user-generated text into a webpage is a basic defense against certain HTML injection issues, since unencoded angle brackets can be interpreted as actual HTML tags rather than displayed as text. This tool handles encoding correctly for display purposes, but for anything security-critical, encoding should happen server-side as part of a proper sanitization process, not solely as a manual client-side step.

HTML entities exist for two overlapping reasons: representing characters that have special meaning in HTML markup itself (like < and & ), and representing characters that might not display correctly across all fonts, encodings, or older systems (like curly quotes or the copyright symbol). Modern UTF-8 encoding has made the second reason far less necessary than it used to be, but the first reason — needing to escape characters that would otherwise be interpreted as markup — remains just as relevant today as it always has been.

Frequently asked questions

Characters like <, >, and & have special meaning in HTML, so encoding them (e.g. < for <) prevents browsers from misinterpreting your text as markup.