The HTML Encoder converts special characters to their HTML entity equivalents (& → &, < → <, > → >, " → ", ' → ') for safe embedding in HTML documents. The decoder reverses this, converting entities back to characters. Essential for displaying code examples, user input in HTML, or data that must not be interpreted as markup.
Safely embed user content or code examples in HTML by encoding special characters. For encoding URL query parameters, use the URL Encoder & Decoder.
Encode for HTML
Input
<script>alert("XSS")</script>Output
<script>alert("XSS")</script>
Percent-encode URLs and query strings, or decode them.
Escape special characters for JSON strings, or unescape JSON string values.
Encode text as a Base64 string.
Minify HTML by removing whitespace, comments, and optional attributes.
Convert Markdown to HTML instantly.
Convert HTML markup to clean Markdown syntax.