Codificatore e decodificatore di entità HTML
Esegui l’escape dei caratteri HTML o decodifica cinque entità con nome di base e riferimenti numerici.
Dati
Suggerimento: premi Ctrl + Enter per eseguire
Impostazioni salvate
Per ora la guida dettagliata qui sotto è disponibile solo in inglese.
Informazioni su questo strumento
To show code or user-supplied text on a web page without the browser interpreting it as HTML, special characters must be escaped as entities. This tool escapes &, <, >, double and single quotes, or decodes the five basic named entities and numeric character references back to characters.
Escaping is essential when inserting text into HTML, but it is not a complete defence against cross-site scripting in every context, such as inside script tags or URLs.
Come si usa
- Paste the text or HTML.
- Choose encode to escape it, or decode to turn entities back into characters.
- Run the tool.
- Copy the result into your page, documentation or template.
Come funziona il calcolo
Encoding replaces & with &, < with <, > with >, " with " and ' with '. Decoding converts those five named entities plus decimal (é) and hexadecimal (é) references.
& < > quotes ⇄ entitiesEsempio pratico
To show <a href="x">Tom & Jerry</a> as text in a tutorial, encoding produces <a href="x">Tom & Jerry</a>. Decoding "<b>café ©" returns "<b>café ©": © is a named entity outside the basic five, so it is left as written.
Esempio di input e risultato
<p> → <p>
Limiti
- Decodes only &, <, >, ", ' and numeric references.
- Does not sanitize or validate HTML.
- Up to 100,000 characters.
Ultimo aggiornamento:
Domande frequenti
Why is © not decoded?
Only the five basic named entities are decoded. Use the numeric form © for ©.
Does escaping make user input safe?
It is safe for HTML text and quoted attribute values. Other contexts, such as JavaScript or URLs, need their own escaping.
Do I need to escape non-English letters?
Not on a UTF-8 page; they can be written directly.
Risoluzione dei problemi
Text shows &amp; on my page.
It was escaped twice. Escape only once, at the point where the text is inserted into HTML.
Named entities like remain.
They are outside the five supported names. Replace them with numeric forms or decode them in an editor.
My CMS still breaks the code sample.
Some editors decode entities on save. Use a code block feature instead.
Privacy & Gratuito
I miei dati vengono salvati?
I tuoi dati restano in questa scheda. Non riceviamo i tuoi file, i testi incollati né i valori dei calcoli.
Questo strumento è gratuito?
Sì. Non servono registrazione né pagamento.
Vedi anche
Passi successivi utili
Formattatore e validatore JSON
Valida, formatta o minimizza JSON in locale. I dati non validi non vengono mai inviati a un server.
Sviluppo e SEOConvertitore da CSV a JSON
Converti intestazioni e record CSV in JSON, con delimitatori tra virgolette e a capo.
Sviluppo e SEOConvertitore da JSON a CSV
Converti un array piatto di oggetti in CSV. Le stringhe simili a formule ricevono un prefisso protettivo per i fogli di calcolo.
Sviluppo e SEO