Skip to main content
SyntixDev

HTML Entities Encoder

Encoding & Crypto

Base64, MD5/SHA/HMAC hashes, JWT decoder, URL query parser, and HTML entities — 100% client-side.

100% client-side — files and inputs never leave your browser.

Result
About this tool and how it works

Escaping text for HTML

Characters such as <, >, &, and quotes have special meaning in HTML. To display them as text — in a code sample, a CMS field, or an email template — they must be written as entities: named (&lt;), decimal (&#60;), or hexadecimal (&#x3C;). This tool converts in both directions.

When to encode

  • Publishing code snippets on a blog or documentation page, so <div> is shown instead of rendered.
  • Pasting text into legacy systems or XML feeds that reject raw non-ASCII characters (encode accents as numeric entities).
  • Inspecting user-generated content that arrived already escaped, e.g. Tom &amp; Jerry after double encoding.

Entities and XSS

Escaping < > & " ' before inserting untrusted text into HTML is the core defence against cross-site scripting. Modern frameworks (React, Astro, Vue) do this automatically for text content; risk appears when you bypass them with innerHTML, dangerouslySetInnerHTML, or string-built templates. Note that HTML escaping is not enough inside JavaScript strings, URLs, or CSS — each context needs its own encoding.

Example

5 < 6 && "ok" encodes to 5 &lt; 6 &amp;&amp; &quot;ok&quot;. Decoding reverses it, including numeric forms such as &#233; (é) and &#x1F600; (😀).

Frequently asked questions

Named, decimal, or hex entities — which should I use?

They render identically. Named entities are easiest to read; numeric entities work for every Unicode character, including those without a name, and are safest for XML.

Why do I see &amp;amp; on my page?

The text was escaped twice. Decode it once here to check, then remove the extra escaping step in your template or API.

Do I need to encode accented letters like é in UTF-8 pages?

No. If the page declares <meta charset="utf-8">, accented characters can be written directly. Encode them only for systems limited to ASCII.

Other tools