HTML Encode & Decode
Turn characters into HTML entities, or expand & © and named references back to text. Encoding never uses the DOM, so pasted markup is not interpreted as HTML.
Tool input stays in your browserDid you know · History
A signed 32-bit Unix timestamp overflows on 19 January 2038, the Y2038 problem.
Plain text
you edit—Encoded
read only—Three encode styles
Minimal only escapes the five XML-significant characters: &, <, >, quotes, and apostrophes. That is what you want before interpolating a string into HTML. Named uses references such as and © when this table knows them, and numeric entities for other non-ASCII. Numeric writes … for everything outside printable ASCII plus the five specials.
Decode is a text rewrite
Decode expands decimal and hexadecimal numeric references and the named set listed above. Unknown names are left unchanged rather than dropped. The converter does not parse HTML, so a fragment containing tags is treated as characters, not a document.
Your copy stays local
Encoding and decoding run as JavaScript in this tab. Unpublished copy, email bodies, and template snippets are not uploaded.
HTML entities FAQ
HTML encode, HTML decode, named entities, numeric character references, and what stays in the browser.
What is HTML encode?
HTML encode replaces characters that would be special in markup with character references such as & and <. This HTML encoder can use a minimal five-character set, named entities where this table knows them, or numeric &#…; references. Encoding is a string rewrite, not an HTML parse.
How do I decode HTML entities?
Paste text that contains &, ©, or ©, choose Decode, and copy the plain result. Named references this page does not list are left unchanged. Decimal and hexadecimal numeric references are expanded.
Named vs numeric HTML entities?
Named entities ( , €) are easier to read in source. Numeric entities work for any Unicode code point. Use Minimal when you only need to make a string safe to interpolate into HTML.
Does HTML decode run innerHTML?
No. Decode is a regular-expression rewrite so pasted fragments are not executed as HTML. That is the safe approach for untrusted copy.
Is the HTML entity tool private?
Yes. Encode and decode run in this tab. Draft copy is not uploaded.