Esta página aún no está traducida al español, así que la mostramos en inglés.

HTML Entity Encoder & Decoder

Escape < > & " so text is safe to show in HTML, convert accents and symbols to named or numeric entities, or decode entity-filled HTML back to plain text.

Actualizado el
Quotes

Tus datos nunca salen de tu ordenador. Todo se procesa localmente en tu navegador.

Cómo usar: HTML Entity Encoder

  1. Choose Encode to escape text for HTML, or Decode to turn entities back into characters.
  2. Paste your text — the result updates as you type.
  3. When encoding, choose which characters to convert (only the HTML-special ones, or also accents, symbols and emoji) and the entity format: named, decimal or hex.
  4. Click Copy. Use Swap to run the result back through the opposite direction.

What are HTML entities?

HTML entities are escape sequences that represent characters which would otherwise be interpreted as markup, or which are hard to type. They start with & and end with ;, in three forms: named (&copy;), decimal (&#169;) and hexadecimal (&#xA9;) — all three display ©. Encoding is essential whenever you show user-supplied text or code samples on a web page: without it, <script> in a comment would be executed instead of displayed.

The five characters you must escape

CharacterEntityWhy
&&amp;Starts every entity
<&lt;Starts a tag
>&gt;Ends a tag
"&quot;Ends a double-quoted attribute value
'&#39;Ends a single-quoted attribute value (&apos; is not defined in HTML 4)

In normal text content, escaping & and < is enough; inside attribute values, quotes must be escaped too. The “Only HTML special characters” option does exactly this and leaves everything else readable — the right choice for UTF-8 pages, which is nearly all of them today.

Do you still need entities for accents and symbols?

If your page is served as UTF-8 (<meta charset="utf-8">), you can write é, € or emoji directly. Encoding all non-ASCII characters is still useful when content passes through systems that are not UTF-8-safe — legacy CMSs, some email templates, XML feeds or source files with an unknown encoding. Named entities exist only for a limited set (Latin-1, Greek letters, common math and typographic symbols); for everything else, such as emoji, numeric references are used: 😀 → &#128512;.

Useful entities to know

EntityResultUse
&nbsp;(non-breaking space)Keep “10 kg” on one line
&shy;(soft hyphen)Optional hyphenation point in long words
&mdash; / &ndash;— / –Dashes
&hellip;…Ellipsis
&ldquo; &rdquo;“ ”Typographic quotes
&euro; &copy; &trade;€ © ™Symbols

How decoding works

The decoder recognizes all 2,231 named character references defined in the HTML Living Standard, plus decimal and hex references. It follows browser rules for edge cases: &#150; becomes an en dash (Windows-1252 mapping) and invalid code points become �. Entity names are case-sensitive — &Eacute; is É, &eacute; is é. For URLs use the URL Encoder instead, and for binary data Base64. Converting HTML to readable text? Try HTML to Markdown.

También se busca como: html escape, html unescape, html entities, html encode, html decode, escape html characters, nbsp, special characters html.

Herramientas que combinan con: HTML Entity Encoder

  • HTML Formatter — Paste minified or messy markup and get clean, consistently indented HTML — including embedded <style> and <script> blocks.
  • Markdown to HTML — Write or paste Markdown and get clean HTML instantly — with a sanitized live preview, GitHub-flavored tables, task lists and fenced code blocks.
  • Traductor de código Morse — Escribe texto para obtener el código Morse, o pega puntos y rayas para descifrarlos; después, escúchalo, mira cómo parpadea y descárgate el audio.
  • Convertidor de texto a binario — Escribe texto para verlo en código binario, o pega código binario (o hexadecimal, octal o decimal) para volver a convertirlo en texto legible.

Preguntas frecuentes

Which characters must be escaped in HTML?
& and < in text content, plus " (and ' if you use single quotes) inside attribute values. Escaping > is not strictly required but is conventional.
Does HTML escaping prevent XSS?
Escaping the special characters is the core defense when inserting untrusted text into HTML content or quoted attributes. It is not sufficient inside <script> blocks, inline event handlers, CSS or href="javascript:…" URLs, which need context-specific handling.
What is the difference between &amp;nbsp; and a normal space?
A non-breaking space (U+00A0) looks the same but prevents a line break at that point, and multiple &nbsp; are not collapsed into one like regular spaces are.
Should I use named or numeric entities?
Named entities like &eacute; are easier to read; numeric ones work for every Unicode character and in XML, which only predefines &amp; &lt; &gt; &quot; &apos;.
Is my text processed on a server?
No. Encoding and decoding happen in your browser, and the text is never uploaded.
¿Puedo instalar HTML Entity Encoder como aplicación web y utilizarla sin conexión?
Sí. HTML Entity Encoder es una aplicación web instalable (PWA): se instala desde el navegador, no se descarga desde una tienda de aplicaciones. Haz clic en «Instalar aplicación» en la parte superior de esta página en Chrome o Edge (Windows, macOS, Linux, ChromeOS) o, en Android, utiliza «Compartir» → «Añadir a la pantalla de inicio» en iPhone y iPad, o «Archivo» → «Añadir al Dock» en Safari 17+ en un Mac. A continuación, se abrirá en su propia ventana con su propio icono y, como se ejecuta íntegramente en tu navegador, seguirá funcionando sin conexión. Firefox en el ordenador de sobremesa no permite instalar aplicaciones web. Cómo funciona la instalación.

Herramientas relacionadas