HTML Entity Encoder & Decoder - Encode HTML Entities Online
Encode and Decode HTML Entities
HTML gives a few characters special meaning: < starts
a tag, & starts an entity and " ends an
attribute value. To show them as text they must be written as
entities. Paste text in Encode mode to escape it, or paste HTML source
in Decode mode to see the characters it represents. Everything runs in
your browser.
Example
Encoding this snippet so it can be shown inside a page:
<a href="/search?q=fish&chips">Café's menu</a> gives:
<a href="/search?q=fish&chips">Café's menu</a>
Put that inside a <pre> or <code>
block and the browser shows the original markup instead of rendering a
link.
Named vs Numeric Entities
Named entities such as © are easier to read in
source. Numeric entities such as © (decimal) or
© (hex) can represent any Unicode character and
work in XML too, where only the five basic named entities exist. The
encoder always writes hex numeric entities for non-ASCII characters,
and ' for the apostrophe, because
' is not defined in HTML 4.
Related Tools
For text going into a URL use the URL encoder, and for string literals in JSON, JavaScript or SQL use string escape. Each context has its own rules, and HTML entities do nothing useful in a URL or a JSON string.
Related Tools
JWT Decoder
Decode JSON Web Tokens and inspect header, payload and signature.
Base64 Encode / Decode
Encode text to Base64 or decode Base64 strings back to plain text.
URL Encode / Decode
Percent-encode or decode URLs and query-string parameters safely.
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text.