Encode special characters like <, >, &, " to HTML entities, or decode entities back to readable text. Prevents XSS when embedding user input.
Type something aboveAn HTML entity encoder converts special characters like angle brackets (<, >), ampersands (&), quotation marks, and backticks into their corresponding HTML entity representations. This is critical for web security because unencoded special characters in user-generated content can be interpreted as HTML or JavaScript by the browser, leading to Cross-Site Scripting (XSS) attacks. When you display user input on a web page, encoding these characters ensures they are rendered as visible text rather than executable code. The decoder does the reverse — converting HTML entities back to their original characters, which is useful when parsing HTML source code or extracting text from encoded content. This free tool handles both named entities and numeric entities, processing everything in your browser without sending data to any server.
Select "Encode" to convert special characters into HTML entities, or "Decode" to convert HTML entities back into readable characters. Switch between modes using the toggle at the top.
Paste your raw HTML, user input, or entity-encoded string into the input field. The tool processes the input in real time and shows the converted output instantly below.
Click the Copy button to copy the encoded or decoded result. Use encoded output in your HTML templates to safely display user content without XSS risks.
Pretty-print and validate JSON with 2 / 4 space indentation.
Convert JSON arrays to CSV format. Auto-detects columns, proper escaping, download as .csv.
Convert CSV data to a JSON array of objects. Handles quoted fields and commas.
Beautify messy HTML with proper indentation or minify it for production.
Minify HTML by stripping comments, collapsing whitespace. Shows size savings.
Beautify CSS with proper indentation or minify it for production. Strips comments.