HTML Entity Encoder
Stop reserved characters from breaking your page. This free HTML entity encoder turns the special characters that HTML treats as markup (&, <, >, quotes) into safe entities, and can decode them back to plain text, all instantly in your browser.
What is an HTML entity encoder?
An HTML entity encoder converts the characters that have special meaning in HTML into entity references so they display as literal text instead of being parsed as tags. In HTML the less-than sign, greater-than sign, ampersand, double quote and apostrophe are reserved: the browser treats them as markup. To show them as text you use an entity — < for <, > for >, & for &, " for double quotes and ' for apostrophes. This is essential whenever you display user input, code snippets, or content you don't want interpreted as HTML, and it is a key defence against data-injection issues. This tool encodes a string in one click, and can also run the reverse: it decodes a block of entities back into readable text. You switch between Encode and Decode, the result updates as you type, and you copy the output. It handles the five most important characters everything else relies on.
How to use
- Choose Encode or Decode.
- Paste your text or HTML entity string.
- The converted result appears instantly — copy it.
Example
Encode the input <div class='note'>A & B 'test'</div>. The output becomes <div class='note'>A & B 'test'</div>, so the browser displays the text rather than treating it as markup.
Common use cases
- Displaying code or user-generated text on a page without it being parsed as HTML.
- Escaping a string before injecting it into an HTML template or email.
- Preventing data-injection issues when outputting user input.
- Decoding a stored or scraped entity string back into readable text.
Pro tips
- Encode before inserting any untrusted text into your HTML markup.
- The apostrophe is encoded as ', which is the most widely supported form.
- Use Decode to turn a pasted entity string back into plain readable text.
- Remember the ampersand itself is encoded as & so it doesn't start a new entity in the output.
FAQ
What is an HTML entity?
An HTML entity is a special sequence like < that browsers render as a single character, such as <. They let you show reserved characters (<, >, &, quotes) in web pages without breaking the HTML.
Why encode HTML entities?
Encoding is needed when you display user input or code on a page: it prevents the browser from treating the text as markup and protects against data-injection issues.
Which entities does this tool handle?
It handles the five most important ones: < (<), > (>), & (&), " (double quote) and ' (apostrophe).
What is the difference between ' and '?
Both represent an apostrophe. ' is the numeric entity and is the most widely supported, so this tool uses it when encoding.
Can it decode entities too?
Yes — switch to Decode and the tool turns a block of entities back into readable text.
Why does the ampersand decode last?
Decoding & last avoids double-decoding strings like &lt;, which should become < as literal text.
Is it private?
Yes — it runs entirely in your browser and nothing is uploaded to a server.
Is it free?
Yes, free and unlimited with no signup.
Related URL tools
- All URL ToolsEncoder, slug generator, URL parser & more — full hub. URL EncoderPercent-encode characters for safe URL transport.
- Base64 Encode / DecodeEncode and decode text or files in base64. >
More FAQs
Are these URL tools free?
Yes, free and unlimited with no signup.
Is my data uploaded?
No. Everything runs in your browser and nothing is sent to a server.
Related searches
html entity encoder, html entity decoder, encode html entities, html entities list, escape html, decode html entities, html special characters, html escape tool, entity code converter, url tools online
Related tools
- Base64 URL EncoderFree base64 URL encoder. Convert text into URL-safe base64 instantly in your browser — no padding, no + or / c…
- Base64 Encode Decode OnlineConvert text to Base64 and decode Base64 back to text online for free. Encode and decode instantly and private…
- Markdown to HTML ConverterConvert Markdown to clean HTML instantly in your browser. Supports headings, lists, code blocks, tables, links…
- Text to Binary ConverterConvert text to binary and back instantly. Turn any words into ASCII binary (0s and 1s) or decode binary to re…
- Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes for any text instantly in your browser. Fast, private and free…
