BuildUtilities

What are HTML entities?

Escape codes like `&amp;` and `&lt;` that let you show `<` and `&` as text without breaking the markup.

Browsers treat `<`, `>`, `&`, and `"` as part of HTML syntax. To display them as literal characters you replace them with entities: `&lt;`, `&gt;`, `&amp;`, `&quot;`.

Failing to escape is the root cause of many cross-site scripting (XSS) bugs, user input ending up in HTML where it gets interpreted as markup.

Frameworks like React escape automatically. When you're hand-writing HTML or building strings, escape on output.

Related tools

Keep reading

Tip Jar