SummaryLog

HTML Entity Encoder / Decoder

Convert special characters to HTML entities and back. Supports named, decimal, and hexadecimal entities.

Common HTML Entities Reference

&-&Ampersand
&lt;-<Less than
&gt;->Greater than
&quot;-"Double quote
&#39;-'Single quote
&nbsp;-(space)Non-breaking space
&copy;-©Copyright
&reg;-®Registered
&trade;-Trademark
&mdash;-Em dash
&ndash;-En dash
&hellip;-Ellipsis

This tool converts text into HTML entities and back. When encoding, reserved characters like & < > " and ' become named entities such as &amp; and &lt;, while any character above ASCII (accents, Korean, Japanese, emoji) is turned into a numeric reference like &#9731;. Decoding reverses the process and restores the original characters.

It solves the problem of displaying code or special symbols safely inside a web page. If you paste raw <div> into HTML it becomes a tag instead of text, and an unescaped & can break the page. Use this when writing documentation, embedding code samples, storing user text, or debugging entities that show up in scraped HTML or RSS feeds.

How to use

  1. Paste plain text or HTML into the Input box, for example a code snippet like <div class="hello">.
  2. Click Encode to replace special and non-ASCII characters with their HTML entities, or click Decode to turn entities back into normal characters.
  3. Read the result in the Output box and use the Copy button to send it to your clipboard.
  4. Use Swap Output to Input to chain operations, and check the Common HTML Entities reference table below for the most-used named entities.

FAQ

Which characters get encoded as named entities versus numeric codes?
Common reserved characters use named entities: & becomes &amp;, < becomes &lt;, > becomes &gt;, " becomes &quot;, and ' becomes &#39;. Punctuation like the em dash, ellipsis, and copyright symbol also map to readable names. Any other character above ASCII (code point over 127) is encoded as a decimal numeric reference such as &#12354;, which every browser understands.
Does decoding support hexadecimal and numeric entities I did not create here?
Yes. Decoding uses the browser's own HTML parser, so it resolves named entities (&copy;), decimal references (&#169;), and hexadecimal references (&#xA9;) alike, even ones produced by other tools.
Why are normal letters and numbers left unchanged when I encode?
Plain ASCII letters, digits, and most basic punctuation are already safe inside HTML, so only reserved characters and non-ASCII characters are escaped. This keeps the output readable instead of bloating it with unnecessary entities.
Is my text sent anywhere?
No. Encoding and decoding run entirely in your browser with built-in JavaScript, so nothing is uploaded. You can safely process private content, internal docs, or pasted source code.