We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
HTML Entity Encoder & Decoder
Was this tool helpful to use?
Your feedback helps us make it better
Convert HTML special characters to and from entity codes for secure web rendering and code display.
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
HTML character references represent characters that would otherwise be interpreted as markup syntax or as the start of another reference. For example, < represents <, and & represents &. References can use names, decimal numbers such as ©, or hexadecimal numbers such as ©.
Choose Encode to turn input text into an HTML-safe text representation, or Decode to interpret character references and return the corresponding characters. The tool has no entity-style or “encode every Unicode character” option. Ordinary letters, non-Latin text, and emoji generally remain readable characters during encoding; the key syntax characters are escaped as needed. Output updates as you edit the input.
For example, encoding <p>A & B</p> produces text that can be displayed as a code sample rather than parsed as a paragraph. Decoding the entities restores the angle brackets and ampersand. That decoded string is still only text; it does not itself execute code. What happens next depends on where another application inserts it.
Character references do not replace URL percent-encoding, JavaScript string escaping, or sanitizing markup. OWASP guidance treats output encoding as context-specific: escaping for an HTML text node is not automatically correct for an attribute, URL, script, or style value.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Choose Encode for ordinary text or markup characters you want to show literally. Choose Decode for a string that already contains HTML character references.
Paste the text into the input area. Use the example control to load a sample, or clear the field before starting another conversion.
The result refreshes automatically and can be copied. To check a round trip, switch direction and place the copied result into the input; the output is not an editable second input.
<h2>A & B</h2> to preserve the tag characters as visible text.<strong>Ready</strong> to restore the original markup characters.Use cases
See how the tool fits into real work and everyday tasks.
Writers can encode a short HTML sample so readers see the tags rather than a rendered element. Check the copied text in the documentation system’s actual context.
Developers reviewing a text export can decode visible references to understand the characters represented in it, then decide how the result should be handled by the receiving application.
Compare a literal less-than sign with < to show how a character reference lets text contain characters also used by markup.
Q&A
Find concise answers to common questions and confusing cases.
No. It can represent characters in HTML text, but attributes, URLs, scripts, and styles have different rules. Use output handling designed for the exact destination and sanitize markup when the task calls for allowing selected HTML.
The encoder focuses on the characters needed for ordinary HTML text serialization. It does not offer an option to turn every character into a numeric reference, and quotes or emoji can remain literal in this output.
Decoding returns characters such as < and >. It does not insert the result into a web page as executable markup.
No. HTML character references use forms such as &; URL encoding uses percent escapes such as %20. They solve different parsing problems.
Notes
Review scope, result limitations, and important precautions before use.
This tool performs character conversion. It does not sanitize HTML, validate an application’s input, or prove that a string is safe to insert into a page.
Related
Discover related tools, collections, and available API capabilities.