ToolSprinkle.

HTML entity encoder

Escape five HTML-special characters or decode named and numeric references. Compare text escaping with sanitization using local examples.

From input to insight.
PROCESSED ON YOUR DEVICE

Ready when you are.

◎ No uploads. Your input stays here.↗ Free to use. No account needed.⌘ / Ctrl + Enter to run

A worked example

Using the default settings. You can try the same input in the workspace.

Input / settings

<h1>Hello & welcome</h1>

Expected result

&lt;h1&gt;Hello &amp; welcome&lt;/h1&gt;
A LITTLE GUIDANCE

How to use HTML entity encoder

Choose Encode to turn HTML-special characters into text references, or Decode to read named and numeric references. Run the tool and copy or download the plain-text result.

Good to know

This is text escaping, not an HTML sanitizer, URL validator or JavaScript/CSS escaper. Decoded markup is shown as text, not rendered as a page.

A few quick answers.

Is escaping the same as sanitizing HTML?

No. Escaping converts special characters to text entities. It does not validate an HTML document or implement an application security policy.

Is my input sent to a server?

No. This tool processes your input in your browser. We don't store your text, files or results. Standard website access logs are separate; read our privacy notes.

Can I use it for free?

Yes. No account, subscription or usage credits are required.

How do I keep my result?

Use Copy or Download after running the tool. Inputs are not saved automatically and disappear when you leave or refresh the page.

HTML text escaping and decoding boundaries

Exactly what Encode changes

Encode replaces & with &amp;, < with &lt;, > with &gt;, double quotes with &quot; and single quotes with &#39;. Other characters, including café and emoji, remain literal Unicode. It is not a converter that turns every non-ASCII character into a numeric entity.

Named, decimal and hexadecimal references

In Decode mode, &amp; &#38; &#x26; all become &. &copy; becomes © and &#x1F30D; becomes 🌍. Decoding follows the browser’s HTML textarea character-reference rules; unknown references can still contain a recognized prefix: &notarealentity; becomes ¬arealentity; because &not is recognized without a semicolon. A reference with no recognized prefix such as &zzunknown; stays unchanged. Use complete references with semicolons rather than depending on forgiving parsing.

One decoding layer, no markup execution

Decoding &amp;lt; returns &lt;, not <. Encoding &lt; produces &amp;lt; because its ampersand is escaped again. Already escaped text can therefore become double-escaped. The result of decoding &lt;strong&gt;Hi&lt;/strong&gt; is the literal text <strong>Hi</strong>; this workspace does not render it as HTML.

Escaping depends on the output context

Text escaping helps display characters as text in HTML, but does not decide which elements, attributes or URL schemes an application should allow. Even quoted HTML attributes need context-appropriate handling; a javascript: URL is not made safe by replacing quotes. Do not use this output as a JavaScript or CSS escaper, or as a replacement for a maintained HTML sanitizer. Prefer safe DOM text APIs when displaying untrusted text.

Choose the encoding for your destination: Base64 text representation, URL parameter values or HTML text escaping. These are not interchangeable security controls. Copy the result before switching tools; input is not transferred automatically.

Keep your flow going.

More developer tools ↗

What would you like to do?

↑ ↓ Navigate · Enter Open · Esc Close. Switching tools clears unsaved input.