HTML Encoder / Decoder
Escape text so it can sit safely inside HTML, or turn entities back into characters. This page only rewrites text — it does not run scripts or render a page.
Text and mode
Limits
- The input is limited to 2 MB of UTF-8 text (8 MB if you load a file). Larger files can run out of memory in a phone browser tab.
- Only a common set of named entities is recognized when decoding; obscure names stay as text.
- The result is plain text. It is not sanitized for XSS and is not run as HTML.
- Surrogate code points and values above U+10FFFF in numeric references are left unchanged.
Result
How to use HTML Encoder
- Paste the textType or load a file of HTML or plain text.
- Choose encode or decodeMinimal escaping, attribute escaping, named entities, or numeric character references.
- Copy the resultCopy or download the rewritten text, or send it back to the input to reverse the step.
What is encoded
Minimal mode replaces &, < and >. Attribute mode also replaces quotes, which is what you want inside an HTML attribute. Named mode uses common HTML5 entity names (for example ©) and numeric references for other non-ASCII characters. Numeric mode uses &#…; for every special or non-ASCII character.
Decoding accepts named entities from a common HTML5 set, decimal { and hexadecimal {. Unknown names are left unchanged. This is not a browser HTML parser and will not execute markup.
Frequently asked questions
Is my text or file uploaded?
No. Everything runs in your browser tab with JavaScript. Nothing you type, paste or drop is sent to a server, logged or stored by ALink Tools.
Will this stop cross-site scripting?
Encoding text before you insert it into HTML is one necessary step, but this page is not a sanitizer. It will not strip script tags or fix unsafe URLs for you.
Why did an entity not decode?
It may be outside the common named set used here. You can still decode it if you rewrite it as a numeric reference, such as  .
Is this the same as URL encoding?
No. Use URL Encoder / Decoder for percent-encoding. HTML entities and URL encoding solve different problems.
Related tools
All toolsURL Encoder / Decoder
Percent-encode or decode URLs, query strings and form values.
Base64 Encoder & Decoder
Encode or decode UTF-8 text, URL-safe Base64, and local files.
XML Formatter
Pretty-print or minify XML in your browser, without sending it to a server.
JSON Formatter & Validator
Format, minify, sort keys, and catch syntax errors cleanly.