WhatIPIP tools + free calculators
Free tool, no signup

HTML Entity Encoder and Decoder (Named + Numeric)

Encode HTML reserved characters as entities or decode entities back to their original characters.

About this tool

HTML reserves five characters that must be encoded when they appear as literal content rather than as part of the HTML structure: the ampersand, the less-than sign, the greater-than sign, the double quote, and the apostrophe. Encoding replaces each with its named entity (like & for &) or numeric entity (like &). When you display user-submitted content, encoding these characters prevents the browser from interpreting them as HTML, which is the foundation of basic cross-site-scripting prevention. This tool converts between plain text and HTML-entity-encoded form in both directions. The named-entity table covers the standard five plus many common typographic characters (em dashes, smart quotes, copyright signs, mathematical symbols). Numeric entities work for any Unicode code point.

Frequently asked questions

4 questions answered

For text content placed between HTML tags, yes. For attribute values, you also need to consider the quote style and which characters need encoding. For JavaScript event handlers or style attributes, HTML entity encoding alone is not sufficient and dedicated context-aware escaping is required. For modern web frameworks (React, Vue, Angular), the framework handles encoding automatically when you bind a variable to a text node; manual encoding is rarely needed.

Related tools

This tool runs in your browser. We do not log or store the data you enter. Results are returned by your own browser and may not match third-party services bit-for-bit if those services interpret edge cases differently.