Text ToolsFree
HTML Entity Encoder
Frequently Asked Questions
Why do I need to encode HTML entities?▼
HTML characters like <, >, &, and " have special meaning in HTML markup. If you insert user-generated text directly into HTML without encoding, an attacker can inject HTML tags or scripts (XSS attacks). Encoding converts < to < so the browser displays it as text, not interprets it as a tag.
Which characters are encoded?▼
The five core HTML entities: & (ampersand) → &, < (less-than) → <, > (greater-than) → >, " (double quote) → ", and ' (single quote) → '. These cover all XSS injection vectors in HTML attributes and content.
When should I encode vs decode?▼
Encode when inserting text into HTML output (templates, user content, emails). Decode when you receive HTML-encoded text and need to display or process the original characters — for example, when parsing HTML-encoded API responses.
Does this encode all Unicode characters?▼
The tool encodes the five critical HTML characters. Extended HTML entities (like , é, etc.) can be decoded. Full Unicode-to-entity conversion is available as an option.
Is the encoding done in the browser?▼
Yes. All HTML entity encoding and decoding happens locally in your browser with JavaScript. No text is submitted to any server.