HTML Entity Encoder / Decoder

Results

In HTML, characters like < and & have special meanings. To show them as text they’re written as entities: < and &. This tool converts in both directions.

How to use it

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

Example: <a href="x">Tom & Jerry</a> encodes to &lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&lt;/a&gt;. Decoding caf&eacute; or caf&#233; gives “café”.

Questions and answers

Which characters must be escaped?

& and < always. > is good practice. Inside attribute values, also the quote character that wraps the value: “ as " or ‘ as '.

Does decoding know every named entity?

It knows numeric entities (all of them) and the common names: accented letters, Greek letters, quotes, dashes, currency, math and arrows. A name it doesn’t know is left as written.

Link with pre-filled values

Add # and these parameters to the end of this page's address to open the tool with values already filled in.

ParameterWhat it sets
textThe text to encode, or HTML to decode.
modeencode or decode.
all1 to also encode non-ASCII characters.

Example: https://toolabelle.com/html-entities/#text=Tom+%26+Jerry+%3C3&mode=encode&all=0

Related tools