Codificador / descodificador de entidades HTML

Codifique caracteres especiais de HTML com segurança, ou descodifique texto codificado. Todo o processamento acontece no seu navegador; seus dados nunca são enviados ao servidor.

When you want a browser to display <div> as text instead of creating a division, the angle brackets have to become &lt; and &gt;. That is HTML entity encoding, and it is also the front line against cross-site scripting: user input rendered without encoding is how script injection happens. This tool converts in both directions.

Como usar

  1. Paste your text or markup into the input.
  2. Press Encode to turn &, <, >, " and ' into their entity forms — the five characters that matter for safe output.
  3. Press Decode to go the other way, turning &amp;nbsp; and friends back into real characters.
  4. Copy the result into your template, documentation or code sample.

Perguntas frequentes

Which characters actually need encoding?
Five: & < > " and '. Everything else is safe in HTML body text. Encoding more than these makes markup unreadable without adding safety.
Is decoding here dangerous?
No. The decoder reads the value out of a textarea element, so the content is never parsed as live HTML and no script can run.
Does this protect my site from XSS?
It is the right transformation, but protection comes from applying it at output time in your code, on every untrusted value. A one-off conversion in a browser tool does not secure an application.
Why is my &amp; turning into &amp;amp;?
You encoded text that was already encoded. Encode exactly once, at the point of output.
Ferramentas de desenvolvedor