Encode special characters to HTML entities. Fast, secure, and completely free. All processing happens in your browser — no data is sent to any server.
HTML entity encoding replaces characters that have special meaning in HTML — <, >, &, ", ' — with their named or numeric entity equivalents (<, >, &, ", '), so the browser displays them as literal text instead of interpreting them as markup. Without this, a piece of text like "5 < 10 && x > 0" placed directly into an HTML page would be misread as the start of a tag, and text containing a raw & could be parsed as the beginning of an incomplete entity reference.
Any time user-generated or dynamic text gets inserted directly into an HTML page — a comment, a search result snippet, a username — failing to entity-encode it first is one of the most common causes of broken layouts and a classic vector for cross-site scripting (XSS). Encoding a literal <script> tag typed by a user into <script> ensures it displays as visible text instead of executing. This tool lets you check exactly what a given string will encode to before you rely on your application's own encoding logic.
No — they solve different problems. HTML entity encoding protects text placed inside HTML markup from being interpreted as tags; JavaScript string escaping protects text inside a JS string literal. Using the wrong one in the wrong context is a common security bug.
Just the reserved characters (<, >, &, ", ') need encoding for safety; encoding every character is unnecessary and makes the text harder to read in the raw HTML source.
It's an important layer, but proper output encoding must match the context (HTML body vs. attribute vs. JavaScript vs. URL) — always combine it with your framework's built-in escaping and a sensible Content Security Policy.
They represent the same character (&) — the first is a named entity, the second is the numeric character reference. Browsers treat them identically.
Yes, the decoder recognizes both forms and converts each back to its original character regardless of which style was used.