HTML Encoder/Decoder
Encode and decode HTML entities
1. What are HTML Entities?
HTML entities are used to display reserved characters in HTML. They start with an ampersand (&) and end with a semicolon (;). This prevents the browser from interpreting these characters as HTML code.
2. How does it work?
Common Entities
- & → &
- < → <
- > → >
- " → "
- ' → '
3. Examples
Ampersand
AT&T → AT&THTML tags
<div>Hello</div> → <div>Hello</div>Quotes
Say "Hello" → Say "Hello"4. Source Code
typescript
1const htmlEntities: Record<string, string> = {
2 '&': '&',
3 '<': '<',
4 '>': '>',
5 '"': '"',
6 "'": ''',
7 '/': '/',
8};
9
10const reverseHtmlEntities: Record<string, string> = {