Turn characters that HTML treats as markup into safe entity codes. Fast, free, and built for simple browser-based workflows.
Paste your text above, then click Encode Entities.
728 x 90 In-Content Ad
HTML Entity Encoder is a free online tool that converts characters with a special meaning in HTML into their entity form, so they display as text instead of being parsed as markup. Paste your text, click Encode Entities, and every ampersand, angle bracket and quote is replaced with a safe equivalent.
It comes up whenever markup has to survive being shown rather than run: putting a code sample in a blog post so the tags appear on screen, dropping a snippet into a CMS field that would otherwise render it, or fixing a page title where a raw ampersand breaks the output. The second mode helps when a file's character encoding cannot be trusted and accents arrive as question marks.
Everything runs inside your browser and nothing you paste is uploaded. That matters when the text is a customer message, an unpublished draft, or a snippet pulled from an internal system. The encoded result stays on your device unless you copy or download it, and the page keeps working with your network disconnected.
Drop the text or markup you want escaped into the Text to Encode box.
Leave What to Encode on the HTML-unsafe characters for normal use, or switch to the non-ASCII option when accents and emoji must become entities too.
Click Encode Entities. The line above the result says how many characters were changed.
Click Copy for the clipboard, or Download to save the escaped text as encoded-entities.txt. Clear empties both boxes.
Yes! All our tools are 100% free to use with no hidden costs, no registration required, and no credit card needed.
Absolutely. All tools run entirely in your browser (client-side). Your data never leaves your device and is not sent to our servers.
Yes, once the page is loaded, the tool will continue to work even if you lose internet connection since it runs in your browser.
There is no strict character limit, but very large amounts of text (100,000+ characters) may slow down your browser.
Yes! All our tools are free for both personal and commercial use.
Five of them: the ampersand, the less-than and greater-than signs, and both quote marks. Ampersands and angle brackets would otherwise start an entity or a tag, and a quote can end an attribute early. The default mode encodes exactly those and leaves everything else as typed.
When you cannot rely on the page declaring UTF-8, or the text passes through a system that mangles accents and emoji. Encoding every non-ASCII character as a numeric entity makes the output pure ASCII, so it survives older editors, email pipelines and databases with the wrong collation.
No. A browser renders an entity as the character it stands for, so an escaped ampersand still appears as an ampersand and an encoded emoji still shows as an emoji. The difference exists only in the source, where the characters can no longer be mistaken for markup.
No, this page only encodes, so the direction is never ambiguous. Use the HTML Entity Decoder for the reverse, which turns named and numeric entities back into the characters they stand for. The two are kept as separate pages for exactly that reason.
It is the core of it, but context decides. Escaping those five characters makes text safe inside HTML content and quoted attributes, which covers most cases. Text dropped into a script block, a URL or an unquoted attribute needs the escaping rule for that context instead.
Because the named form for an apostrophe was never part of HTML 4, and some older browsers and XML parsers do not recognise it. The numeric entity means the same character and is understood everywhere, so it is the safer choice when you do not control where the output is rendered.