Easily convert special characters into HTML entities or decode them back to plain text. Use this free online tool to make your code web-safe and prevent HTML errors
An HTML encoder converts characters that have a special meaning in HTML into entities, so they are displayed as text instead of being read as markup. An HTML decoder turns entities back into the characters they stand for. Use it to show code samples on a web page, to safely include user text in HTML, or to read entity-filled text from a feed or database. It runs in your browser.
< or ' into Data to decode and click Decode.The five characters that matter most are always encoded:
| Character | Entity | Why |
|---|---|---|
< | < | Starts a tag |
> | > | Ends a tag |
& | & | Starts an entity |
" | " | Ends a double-quoted attribute |
' | ' | Ends a single-quoted attribute |
This tool also encodes other punctuation as numeric entities (for example / as /) and common symbols such as ©, € and ½ as named entities. That is more than browsers strictly need, but it is harmless and keeps the output plain ASCII.
&lt; shows entities on the page instead of characters. It was encoded twice; decode once.<script> block or a URL you need JavaScript escaping or URL encoding instead.& appears literally. Only encode text that will be rendered as HTML.Encoding user-supplied text before inserting it into HTML content or quoted attributes is a key defence against cross-site scripting. It must match the context: script blocks, URLs and CSS need their own escaping. Templating engines that escape automatically are the safest option.
Named entities use a name, like © for ©. Numeric entities use the Unicode code point, in decimal (©) or hex (©). Both display the same character.
HTML encoding uses entities like < so text displays correctly in a page. URL encoding uses %XX codes so text can travel inside a URL.