HTML Entity Encoder & Decoder
Convert special characters to and from named/numeric HTML entities.
Related tools
URL Encoder / Decoder
Encode or decode URL components and query parameters.
HTML Formatter & Beautifier
Beautify, format, and indent HTML markup with standard tag nesting.
HTML Minifier
Minify HTML markup by removing comments and unneeded whitespace.
Remove Special Characters
Strip punctuation, symbols, and non-alphanumeric characters from text.
HTML to Markdown Converter
Convert HTML markup (headings, links, tables, lists) to clean Markdown.
Characters like <, >, &, and quotation marks can break HTML markup or open the door to injection issues if they aren't escaped properly, and this html entity encoder decoder converts them to safe named or numeric entities in an instant. Front-end developers sanitizing user input, content editors pasting text into a CMS, and students learning HTML can convert in either direction — turning raw text into &-style entities, or decoding entity strings back into readable characters. The whole conversion happens locally in your browser, so pasted content, including anything sensitive, never touches a server. There's no signup and no limit on how much text you can process. Enter your text below to see the escaped or unescaped result right away.
Features
- Encode special characters to named HTML entities (&, <, >, etc.)
- Encode to numeric decimal or hexadecimal entity codes
- Decode HTML entities back to their original characters
- Handles full Unicode text including accented letters and symbols
- Bulk conversion of multi-line HTML or plain text
- One-click copy of the escaped or unescaped output
- No length limit on input text
- Instant, real-time conversion as you type
Why use this html entity encoder / decoder?
- Escapes and unescapes text instantly with no lag
- Keeps your markup and content private since nothing is uploaded
- Produces standards-compliant HTML entity output
- Clean interface that requires no HTML expertise
- Free to use with no account or rate limits
Frequently asked questions
Why do I need to encode HTML entities?
Characters like <, >, and & have special meaning in HTML, so they must be encoded as entities to display correctly and to prevent them from being interpreted as markup.
What's the difference between named and numeric HTML entities?
Named entities like & are easier to read, while numeric entities like & or & work even in contexts that don't recognize the named form.
Does this tool help prevent XSS attacks?
Encoding user-supplied text into HTML entities is one part of preventing cross-site scripting, but it should be combined with proper server-side sanitization and context-aware escaping.
Can I decode a block of HTML entities back to plain text?
Yes, paste any text containing HTML entities and the tool will convert it back to its original readable characters.
Will this tool encode emoji and non-Latin characters?
Yes, it correctly converts Unicode characters, including emoji and accented letters, into their numeric HTML entity equivalents.
Is my pasted HTML content uploaded anywhere?
No, all encoding and decoding runs locally in your browser using JavaScript, so nothing is sent to a server.
From the blog
JSON Escape Characters Explained
JSON escape characters explained: the nine valid escape sequences, escaping quotes and backslashes, \uXXXX and emoji surrogate pairs, and nested JSON strings.
The Complete Guide to Text Encoding on the Web
A complete text encoding guide: how Unicode and UTF-8 store characters as bytes, plus Base64, percent-encoding, HTML entities, hex, and how to fix garbled text.