File to HTML entities converter
Convert text or a text file to HTML entities in your browser: nothing is uploaded, there is no limit on how much you convert, and you choose whether accents and other non-ASCII characters are converted as well.
Drop your file here
Tekstbestand, zoals .txt of .html · of plak met Ctrl+V
How it works
-
Choose a file or type text
Drop a file in the box, choose it on your device or type text.
-
Encoded instantly
The HTML-entiteiten result appears at once; change the options if you like.
-
Copy or download
Copy the text with one click or save it as a .txt file.
What is converted
&,<,>,"and'are always converted (&,<,>,",').- With Also accents and other non-ASCII characters, letters such as é, symbols such as € and emoji are converted too. Names like
éare used where they exist; everything else becomes a number such as😀.
Text files only
HTML entities are for text. If you pick an image or another binary file, the tool warns you; use Base64 for those instead.
Why encode text for HTML
If you show code or user text on a web page, characters like < and & must be written as < and &, or the browser reads them as markup. Showing the text of a file, a code sample or a comment as it is, without it being interpreted, is exactly the job of HTML entities. It is also the basic protection against injecting unwanted markup into a page.
Do accents need converting?
Usually not. If your page is saved as UTF-8, which every modern page is, you can write é and € directly. Convert them only when the target cannot handle UTF-8, such as some old email systems, XML feeds with the wrong encoding or code that is saved as ASCII. The option Also accents and other non-ASCII characters does that and uses names such as é where they exist and numbers such as 😀 for the rest.
What is left alone
Letters, digits, spaces and line breaks are not changed, so the result stays readable.
For the opposite, HTML entities to file decodes. To remove tags from HTML instead of escaping them, see remove HTML tags.
Private by design
The conversion happens in your browser. Nothing is uploaded.
Frequently asked questions
Which characters are always converted?
The ampersand, the less-than and greater-than signs, and both double and single quotes.
Do I need to convert accents?
Only if the place where you use the text cannot handle UTF-8. In normal UTF-8 pages é and € can be written directly.
Can I convert an image or a PDF?
No. Entities are for text. For binary files use Base64 instead.
Is my text uploaded?
No. The conversion happens in your browser.