ToolBark
Developer

HTML Encode / Decode

Encode or decode HTML entities.

About

Need to safely embed user-generated content or template literals in a web page? This free HTML encode / decode tool instantly converts special characters like &, <, >, ", and ' into their HTML entities—and decodes them back—right in your browser. No data is sent to any server. Paste your text, click Encode or Decode, and copy the result in one click.

FAQ
What does HTML encoding do?+

HTML encoding replaces characters that have special meaning in HTML—such as &, <, >, ", and '—with safe escape sequences called HTML entities (e.g. & becomes &amp;, < becomes &lt;). This prevents browsers from misinterpreting your content as markup and is essential for security when displaying user-supplied text.

When should I decode HTML entities?+

You should decode HTML entities when you receive data from an API, database, or feed that has already been encoded and you need the plain text version—for example before processing it in JavaScript or displaying it inside a non-HTML context like a plain-text email or a PDF.

Why is & encoded first during HTML encoding?+

The ampersand (&) is the opening character of every HTML entity, so it must be encoded first. If you encoded other characters first, the & characters introduced by those encodings would themselves be re-encoded, producing double-encoded output like &amp;lt; instead of &lt;.

Is my data sent to a server when I use this tool?+

No. All encoding and decoding happens entirely inside your browser using JavaScript. Nothing you type is transmitted over the network, making it safe to use with sensitive or proprietary content.

Related tools