HTML Entity Encoder
Encode special characters to HTML entities or decode them back.
& < > " ' + numeric character referencesWhat the HTML Entity Encoder does
This tool converts special characters into their HTML entity equivalents and converts entities back into plain characters. In HTML, characters like the angle brackets, ampersand, and quotation marks have structural meaning, so when you want to display them as literal text rather than have the browser interpret them as markup, they must be escaped. For example, the less-than sign becomes < and the ampersand becomes &.
It is built for web developers, technical writers, and anyone who needs to safely embed code snippets, user-generated text, or sample markup inside a web page. Escaping these characters is also an important step in preventing broken layouts and cross-site scripting issues caused by unescaped input being treated as live HTML.
How to use it
Choose the Encode tab to turn raw text into entities, or the Decode tab to turn entities back into readable characters. Switching tabs clears both fields so you start fresh. Paste or type your text into the input box, then press the Encode or Decode button to produce the result.
The output appears in a read-only box below. Click Copy to place the result on your clipboard. The encoder escapes the five characters ampersand, less-than, greater-than, double quote, and single quote, while the decoder also resolves numeric character references such as ' back to their original character.
Tips and notes
Always encode the ampersand first when escaping by hand; this tool already handles the correct order for you, so you can paste a full snippet without worrying about double-encoding. Encoding is reversible, so you can round-trip text through Encode and then Decode to confirm it matches the original.
Everything runs locally in your browser using plain JavaScript. Nothing you paste is uploaded to a server, which makes the tool safe to use even with sensitive markup or private content.