HTML Entity Encoder and Decoder
Convert text to safe HTML entities or turn entities back into plain characters β instantly and entirely in your browser.
π How it works & FAQWhat HTML entities are
Certain characters carry special meaning in HTML. A left angle bracket (<) starts a tag, an ampersand (&) starts an entity, and quotation marks close attribute values. If you drop raw text containing these characters into a page, the browser may misread it β breaking your layout or, worse, opening the door to script injection. HTML entities are safe stand-ins: < renders a literal <, & renders a literal &, and ' renders an apostrophe. Encoding swaps the risky characters for these codes; decoding reverses the process so you can read the original text.
Encode, decode, and non-ASCII
Encode mode converts the five reserved characters β &, <, >, double quote, and single quote β into their entity forms. Tick "Encode all non-ASCII" to also turn accented letters, emoji, and other symbols into numeric entities like é, which is handy for older systems or strict ASCII-only pipelines. Decode mode accepts named entities (like ©), decimal entities (©), and hex entities (©) and returns the plain characters.
How to use it
- Pick Encode or Decode from the Mode menu.
- When encoding, optionally tick Encode all non-ASCII for numeric entities.
- Type or paste your text into the input box β the result updates as you type.
- Click Copy result to grab the output, or Swap to feed it back and reverse the conversion.
FAQ
- Is my text sent anywhere?
- No. Everything runs in your browser with JavaScript. Nothing is uploaded or stored on a server.
- Which characters get encoded?
- By default only &, <, >, and both quote styles. Enable the non-ASCII option to also encode any character above code point 127.
- Does decoding handle named and numeric entities?
- Yes β named ( ), decimal ( ), and hexadecimal ( ) entities all decode correctly.
- Is single-quote encoding safe for attributes?
- Yes. Encoding apostrophes as ' keeps text safe inside single-quoted HTML attribute values.