أداة: HTML entity converter
ما الذي يقدمه هذا القسم
Encode turns literal characters like <, >, &, or quotes into entity references so they can live safely inside HTML or XML text nodes when required. Decode reverses named (&), decimal, and hex references back into Unicode characters. Context matters: attribute escaping differs from script embedding; this tool handles string transforms, not a full XSS sanitizer pipeline.
متى تستخدمها
Use it when CMS exports double-escape apostrophes, when RSS readers show raw entities, or when you migrate legacy databases that stored HTML-encoded blobs. After conversion, still run trusted sanitizers for user HTML—never innerHTML untrusted output based only on entity flipping. Pair with أداة: HTML tags remover when you need plain text, and with Markdown إلى HTML when authoring mixed markup.
مثال عملي
A translation feed prints — literally on the site. Decoding the stored string reveals the upstream CMS saved pre-encoded entities while your renderer encoded again. Normalize storage rules once instead of patch-fixing per locale.
أسئلة شائعة
Does encode make text "safe"?
Only for the layer you target. JavaScript contexts, URLs, and CSS need different escaping tables.
Numeric entities versus named?
Both represent Unicode code points. Named entities need DTD awareness in strict XML; numeric always works if allowed.
Why decode mangles emoji?
Surrogate pairs or mixed UTF-8/Latin-1 sources may need charset normalization before entity work.