Developer Utilities

HTML Encoder

All tools

Convert markup into entity-escaped text you can place safely inside a page or template.

How it works

Four simple steps

1

Paste markup or text

Anything you want displayed literally rather than parsed.

2

Four characters escaped

&, <, > and double quotes become named entities.

3

Check the output

The escaped version updates live in the right-hand panel.

4

Copy into your page

Paste it between tags or inside a double-quoted attribute.

HTML Encoder

About HTML Encoder

You are writing a docs page that shows a snippet like <button disabled>, and the browser keeps rendering an actual button. The angle brackets need to become entities before they go into the HTML. Paste the snippet here and copy the escaped version.

The encoder replaces four characters: & becomes &amp;, < becomes &lt;, > becomes &gt; and the double quote becomes &quot;. Everything else, including single quotes, accented letters and emoji, is left as it is, which is fine for UTF-8 pages. Output updates as you type, with Copy, Download, Sample and Clear buttons above the panels. Because & is always escaped, text that already contains entities gets escaped again, so &lt; turns into &amp;lt;. Encode raw text only.

Know what this protects and what it does not. Escaping these characters is the right treatment for text placed between tags or inside a double-quoted attribute. It is not enough inside a single-quoted attribute, a script or style block, or a URL attribute such as href, where different rules apply; use your template engine's context-aware escaping there. To reverse the process, the HTML entity decoder restores the original, and the HTML to plain text tool strips tags entirely when you only want the words.

The replacement is a handful of string operations in your browser tab, so snippets from private repositories are not sent anywhere.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

The encoder covers &, <, > and the double quote, which is enough for element content and double-quoted attributes. If the output goes inside a single-quoted attribute, replace ' with ' yourself or switch that attribute to double quotes.

No. Non-ASCII characters are left as they are, since any page served as UTF-8 displays them directly. Named entities for accented letters are only needed for legacy encodings.

For text inserted between tags, yes. For JavaScript strings, CSS, URLs in href or src, and unquoted attributes, no. Each context has its own escaping rules, so rely on a framework that escapes by context in application code.

View more FAQs

Related tools

View all

Cron Calendar

Explain cron expressions and preview the next run times in any timezone.

Open

CSV to SQL

Infer column types and generate CREATE TABLE + INSERT statements from CSV.

Open

SQL Query Builder

Build SELECT queries visually and reverse-parse SQL into a structure tree.

Open

Log Pattern Miner

Cluster log lines into templates, surface anomalies, and mask PII locally.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools