& HTML Entity Encoder / Decoder

Encode text to HTML entities and decode HTML entities back to readable text. Supports named, decimal, and hex entities. Free online HTML entity encoder and decoder.

Input
Output

How to Use

1

Paste your text

Paste HTML, code, or any text containing characters you want to encode or entity codes you want to decode.

2

Choose mode

Select Encode (text → entities) or Decode (entities → text). Toggle "Non-ASCII only" for partial encoding.

3

Copy the result

The output updates instantly. Click Copy to clipboard to use in your project.

Frequently Asked Questions

What are HTML entities? +
HTML entities are codes used to represent characters that have special meaning in HTML, or characters that are difficult to type. For example, < becomes &lt;, > becomes &gt;, & becomes &amp;, and © becomes &copy;. They prevent browsers from misinterpreting content as markup.
What is the difference between named and numeric entities? +
Named entities use descriptive names (&amp;, &copy;, &reg;). Numeric decimal entities use the character's Unicode code point (&amp;#38; for &). Numeric hex entities use the hex form (&#x26;). All three represent the same characters; named is most readable, numeric works for any character.
What does "encode only non-ASCII" mean? +
When enabled, only characters outside the standard ASCII range (above code point 127) are encoded. ASCII-safe HTML characters like < > & are left as-is. Useful when you want to safely include international text in HTML without encoding every character.
When should I encode HTML entities? +
Always encode user-generated content before inserting it into HTML to prevent XSS attacks. Encode characters in HTML attributes, especially those that accept URLs. Encode < > & " in any text that will be rendered inside HTML tags.
Is my text sent to a server? +
No. All encoding and decoding runs entirely in your browser using JavaScript. Your text never leaves your device.


Tam Rehber: HTML Entity Kodlayıcı / Çözücü

HTML varlık kodlaması, özel karakterlerin güvenli HTML gösterimleriyle değiştirilmesi işlemidir. Web geliştirmenin en temel güvenlik uygulamalarından biridir ve en sık yanlış anlaşılanlardan biridir.

HTML'de Kaçınılması Zorunlu 5 Karakter

İsimli ve Sayısal Varlıklar

PHP: htmlspecialchars ve htmlentities Farkı

// htmlspecialchars: yalnızca 5 kritik karakteri kodlar
$guvenli = htmlspecialchars($girdi, ENT_QUOTES | ENT_HTML5, 'UTF-8');

// htmlentities: HTML varlık karşılığı olan TÜM karakterleri kodlar
$kodlu = htmlentities($girdi, ENT_QUOTES | ENT_HTML5, 'UTF-8');

UTF-8 belgeler için htmlspecialchars neredeyse her zaman doğru seçimdir. UTF-8 ile tüm karakterler doğrudan temsil edilebilir — onları HTML varlıkları olarak kodlamak gerekmez.

JavaScript: DOMParser ile Varlık Çözme

function htmlVarliklariniCoz(metin) {
  const doc = new DOMParser().parseFromString(metin, 'text/html');
  return doc.documentElement.textContent;
}

Uyarı: kullanıcı tarafından sağlanan dizeler üzerinde varlıkları çözmek için asla innerHTML kullanmayın — bu XSS riski yaratır. DOMParser yaklaşımı textContent döndürdüğü için güvenlidir.

İlgili araçlar: Base64 Encoder ikili güvenli kodlama için, URL Encoder URL'lerde kullanmak üzere yüzde kodlama için kullanılabilir.

🧰 50+ Tools