HTML Entity Encoder
Encode ampersands, angle brackets and quotes as HTML entities. Preview the converted text, copy it, and compare examples before using it in markup.
Use this result well
- Inputs that matter
- Text, the HTML Entities Encode/Decode choice and, for decoding, the Text, Attribute value or Require semicolons context.
- Output to expect
- Escaped &, <, > and quote characters, or text decoded from HTML named and numeric character references.
- How it works
- Encoding replaces five characters once. Decoding follows the selected character-reference rules for one layer; a chain can choose a context for each HTML decoding step.
- Text and attribute rules can differ when a semicolon is missing. Require semicolons keeps incomplete references unchanged; it does not validate a whole document.
- Copy returns only the output text. Review it before inserting it into another context; converting references does not sanitize a page or execute its markup.
- Text input is limited to 2,000,000 UTF-16 units and each result to 20,000,000. Large conversions can be cancelled or retried.
- Chains allow up to 12 steps. Intermediate previews are shortened; Copy retains the complete final result.
Related Tools
Tools you might need next
Decode HTML named and numeric character references with text, attribute-value or semicolon-required rules. Preview and copy one decoding layer.
Encode UTF-8 text with RFC 4648 standard or URL-safe Base64 and an explicit padding policy, with strict errors and no encryption claim.
Percent-encode one Unicode URI component with encodeURIComponent semantics, explicit context limits, and malformed UTF-16 rejection.
Reference & details
How it works
Updated September 2026
How it works
Updated September 2026Five-character replacement
The encoder replaces each matching character once in the original input. Characters introduced by that replacement are not encoded again during the same operation.
Immediate text preview
Input changes update the output. The Single Transform view performs the selected operation; Chain Transform applies the configured steps in their displayed order.
Use the destination context
Review where the result will be inserted. Escaping HTML text does not check an entire page or replace the rules for URLs, scripts, styles and other formats.
Updated: September 2026
Example Scenarios
Encode a short tag example for display as text.
→ <b>A&B</b>
Compare the references used for a double quote and an apostrophe.
→ "It's"
Check how an already encoded reference changes before pasting it into documentation.
→ &lt;
FAQ
About HTML Entity Encoder
Convert the five characters &, <, >, double quote and apostrophe into HTML references. Paste text into the editor to see the result. The page opens with HTML Entities and Encode selected; other conversions are available in the same panel.