What Are HTML Entities?
When you display user text inside an HTML page, characters like <, > and & can be misread as tags or entities — breaking the layout or opening XSS risks. Converting them to HTML entities (e.g. < becomes <) keeps the text literal and safe. This free HTML Entity Encoder / Decoder escapes and unescapes those characters instantly in your browser.
An HTML entity is a special code that represents a character that either cannot safely appear in HTML source or would be misinterpreted as markup. The most common examples are < and > for < and >, & for & and " for quotation marks inside attributes. Entities can also represent characters that are hard to type directly, such as non-breaking spaces ( ), copyright symbols (©) and accented letters from European languages.
How to use it
- Choose Encode (text → entities) or Decode (entities → text).
- Paste your content — the result updates instantly.
- Copy the output into your HTML, template or CMS.
Use Cases
- Encoding user-generated text before inserting it into an HTML page to prevent cross-site scripting (XSS) attacks.
- Decoding HTML entities in scraped web content to recover the original readable text.
- Converting special characters in blog post content or CMS output to their entity equivalents for safe display.
- Looking up the entity code for a symbol like ©, — or € when writing HTML templates.
How HTML Entity Encoding Works
The encoder replaces the five characters with special meaning in HTML — <, >, &, ' and " — with their named entities: <, >, &, ' and ". This is the minimum set required to prevent markup injection. Optionally, extended encoding also replaces non-ASCII characters with their numeric entities (&#nnnn;) for maximum compatibility with older parsers.
Decoding is the reverse: named entities and numeric entities (&#8364; = €) are replaced with their Unicode characters. The tool uses the browser's own HTML parser for decoding by setting innerHTML and reading back textContent — the most reliable approach because it handles all entities the browser understands.
Why use this tool
- Handles the five HTML-significant characters and numeric entities.
- Two-way, instant conversion with one-click copy.
- Private and free — runs entirely in your browser.
Privacy
Encoding and decoding run entirely in your browser. The text you enter is never sent to our servers.