Encode text as HTML entities (named, decimal or hex) or decode &, é and é back, the way browsers do
Encode text so it shows as written inside HTML, or decode entities like & and é back to the characters they stand for.
How to use it
Choose Encode or Decode, then paste text or open a file. To encode, pick how references are written and which characters become one. To decode, say whether the text sits in an attribute value. Copy or download the result. Notes above it name anything left as written, or text that was encoded twice.
Examples
Encode a link to show its HTML on a page
<a href="/menu?dish=fish&chips">Fish & chips</a>
<a href="/menu?dish=fish&chips">Fish & chips</a>
Characters: &<>"' (the default). That is enough for text and for attribute values in quotes.
Decode names and numbers
Café & crème — €5
Café & crème — €5
Encode everything outside ASCII, as decimal numbers
naïve “quotes”
naïve “quotes”
Write as: Decimal, Characters: Non-ASCII. For a page or email whose character set isn’t UTF-8.
The same text read as text, and as an attribute value
?a=1¬=2
Read as Text: ?a=1¬=2 Read as Attribute value: ?a=1¬=2
Old names like ¬ work without the ";" in text, so a link’s "¬=" turns into ¬ there. In an attribute value browsers leave it as written.
Names, decimal or hex
Which characters to encode
&<>"': the five that can change how HTML reads your text. Enough for text in a UTF-8 page and for attribute values in quotes. Non-ASCII: also every character outside ASCII (é, “, emoji). For a page, email or system that isn’t UTF-8.
How decoding reads the text
Questions
- Why does decode to a space that isn’t a normal space?
is the no-break space, U+00A0. It looks like a space but is a different character, so a search for a normal space won’t find it. Decoding keeps it as it is. - Do I need to encode quotes?
In text between tags, only & and < matter. Inside an attribute value, the quote that wraps it must be encoded. The default, &<>"', covers both. - Is HTML encoding the same as URL encoding?
No. Entities make text safe inside HTML (& is &, < is <); URL encoding makes it safe inside a URL (& is %26). A link in an href can need both: URL-encode each value, then write the & between parameters as &, as the first example does. - Is my text uploaded?
No. Everything runs in your browser, so your text stays on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. Templates and emails can hold keys, and the page warns you if it spots one.