Esta página ainda não foi traduzida para o português, por isso aparece em 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.

Atualizado em
Quotes

Seus dados nunca saem do seu computador. Todo o processamento acontece localmente no navegador.

Como 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.

Também pesquisado como: html escape, html unescape, html entities, html encode, html decode, escape html characters, nbsp, special characters html.

Ferramentas que combinam com: 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.
  • Tradutor de código Morse — Digite um texto para obter o código Morse ou cole pontos e traços para decifrá-los — depois, ouça, veja os sinais piscarem e baixe o áudio.
  • Conversor de texto para binário — Digite um texto para vê-lo como código binário ou cole um código binário (ou hexadecimal, octal ou decimal) para convertê-lo de volta em texto legível.

Perguntas frequentes

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.
Posso instalar o HTML Entity Encoder como um aplicativo da web e usá-lo offline?
Sim. O HTML Entity Encoder é um aplicativo da web instalável (PWA) — instalado a partir do seu navegador, não baixado de uma loja de aplicativos. Clique em “Instalar aplicativo” na parte superior desta página no Chrome ou no Edge (Windows, macOS, Linux, ChromeOS) ou, no Android, use “Compartilhar” → “Adicionar à tela inicial” no iPhone e no iPad, ou “Arquivo” → “Adicionar ao Dock” no Safari 17+ em um Mac. Em seguida, ela se abre em uma janela própria com seu próprio ícone e, como é executada inteiramente no seu navegador, continua funcionando offline. O Firefox no desktop não permite a instalação de aplicativos da web. Como funciona a instalação.

Ferramentas relacionadas