HTML Entity Encoder

Encode and decode HTML entities to escape special characters

What are HTML Entities and Why Encode Text?

In HTML, certain characters are reserved for defining the page structure itself. For example, the browser interprets < as the start of a tag. If you want to display this character literally, you must use an HTML entity (&lt;). Without this conversion, the browser will attempt to "execute" the code, which can break the layout or hide content.

Defense Against XSS Attacks

HTML encoding is the primary line of defense against Cross-Site Scripting (XSS). By encoding user-provided data before inserting it into a page, you ensure that any malicious script (like <script>) is treated only as harmless text, protecting your visitors' sessions and data.

Basic vs. Hexadecimal Encoding

  • Basic (Named Entities): Replaces only critical characters (< > & " ') with easy-to-remember names (e.g., &quot;).
  • Hexadecimal (Encode All): Transforms every character in your string into a numeric code (e.g., &#65; for 'A'). This is useful for obfuscating email addresses against scrapers or ensuring rendering on systems with limited character sets.

Total Privacy (Local Processing)

Your data security is non-negotiable. Octovelo performs all HTML entity conversions directly in your browser. The content you encode or decode is never transmitted to our servers. This allows you to sanitize code snippets or sensitive data with total peace of mind.