HTML Entity Encoder & Decoder
Convert characters like <, >, & and quotes into HTML entities so they display literally, or decode entities back to characters.
About this tool
Convert characters like <, >, & and quotes into HTML entities so they display literally, or decode entities back to characters.
Example
Input: <a href="x">
Output: <a href="x">
Privacy
This tool runs entirely in your browser. Your data is processed locally and never uploaded to a server.
How to use this tool
- Paste the text or HTML entities into the input box.
- Choose whether you want to encode text or decode entities.
- Run the tool to convert the content.
- Copy the result and use it in your HTML, template, or editor.
Step by step, what happens
- The tool reads the text you entered and checks it for characters that need HTML escaping or entity decoding.
- If you choose encode, it replaces special characters such as <, >, and & with their HTML entity forms.
- If you choose decode, it turns entity text such as & or < back into the original characters.
- The converted output is shown so you can review it before copying it.
Worked example
For example, if you want to safely show a less-than sign in HTML, you can convert a short sentence with special characters.
Input: 5 < 7 & 9
- Enter the text exactly as you want it processed.
- Select HTML entity encoding so the special characters are escaped for HTML use.
- The tool replaces the less-than sign and ampersand with their entity forms.
- Copy the encoded result into your page or code.
Output: 5 < 7 & 9
Tips and common mistakes
- Use encode when you want to display raw text inside HTML without it being interpreted as markup.
- Use decode when you pasted entity text from a source and need the original readable characters back.
- Be careful not to encode text twice, because you can end up with visible entity text like &lt;.
- If your input already contains HTML tags that you want to keep as text, encoding will make them safe to display.
Frequently asked questions
What are HTML entities?
HTML entities like < and & represent characters that have special meaning in HTML so they show literally instead of being parsed.
Why encode HTML?
To safely display code or user content on a page without it being interpreted as markup.
Is decoding safe?
Decoding here only converts entities back to text; it does not execute any HTML.
More Developer Tools Tools
Explore related calculators in this category
HTML Minifier
Minify HTML by removing comments and collapsing whitespace. Reduce page size instantly.
HTML Preview
Preview HTML rendered live in a sandboxed frame. See how your markup looks instantly.
HTML Validator
Check HTML for basic issues, unclosed tags and mismatched nesting. Free online HTML checker.
.htaccess Generator
Generate common .htaccess rules, force HTTPS, www redirect, and caching, with checkboxes.
You Might Also Like
Popular tools from other categories
Remove HTML Tags
Strip all HTML tags from text, leaving only the plain text content.
1031 Exchange Calculator - Free Online
Free Calculate tax deferral in a 1031 exchange. Step-by-step solutions and formulas included. Fast, accurate, and free, with formula and example.
4% Rule Calculator
Find the retirement nest egg you need using the 4% safe-withdrawal rule.
70% Rule Calculator
Calculate max offer using the 70% rule for flips.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.