← Tornar a les funcions
Free

HTML Entity Encoder

HTML Entity Encoder converts special characters (< > & " ') to their HTML entity equivalents (&lt; &gt; &amp; &quot; &#39;) and back. Essential for safely rendering user content, embedding code in documentation, or preventing XSS when displaying user input.

When you need to display HTML tags as text, embed code snippets in a page, or show user-submitted content safely, HTML entity encoding is the answer. This tool provides instant bidirectional conversion. Encoding replaces special HTML characters with their entity equivalents so the browser displays them literally instead of interpreting them as markup. Decoding reverses the process. The tool handles the five core XML entities plus numeric entity references (&#NN; and &#xHH;) so you can work with any encoded content. Real-time conversion means output appears as you type, and a swap button flips input and output for quick roundtrip verification.

Vista prèvia en viu
example.com
HTML Entity Encoder Encode Decode
Input
<div class="box">Hello & welcome!</div>
Encoded Output
&lt;div class=&quot;box&quot;&gt;Hello &amp; welcome!&lt;/div&gt;
&lt; &gt; &amp; &quot; &#39;
Funcions clau

Encode Special Characters

Converts < > & " ' into &lt; &gt; &amp; &quot; &#39; — the five reserved HTML characters that need encoding to display as text.

Decode Entity References

Decodes both named (&amp; &lt; &nbsp;) and numeric (&#60; &#x3C;) entity references back to their original characters.

One-Click Copy

Copy the encoded or decoded result with a single click. Move output directly into your HTML, documentation, or source code.

Real-Time Conversion

Output updates live as you type. No encode button to click — see results immediately for fast iteration.

Handles Numeric Entities

Supports decimal (&#65;) and hexadecimal (&#x41;) numeric references plus named entities like &amp;nbsp;, &amp;copy;, &amp;trade;.

Roundtrip Verification

Encode, then decode the result to confirm the output matches the original — a quick way to verify you're handling content safely.

Casos d'ús comuns

Embedding Code in Docs

To display HTML tags as literal text in a markdown or HTML page, encode the special characters — no more accidentally rendering your code sample as markup.

Preventing XSS

Before echoing user input back to a page, encode HTML entities to neutralize <script> tags and other injection vectors.

Debugging Malformed HTML

Decode entity references in suspicious output to see what characters were actually produced — helps pinpoint escaping bugs.

Content Migration

Convert HTML with entities from one system (a CMS, email template) into plain text for another (a database field, plain-text email).

Tooltip & Attribute Safety

Encode content before inserting into HTML attributes (title="...", data-*) so quotes and special chars don't break the attribute.

Com utilitzar-lo
1

Open HTML Entity Tool

Click the HTML Entity icon in the DevSuite Pro dock. An editor panel opens with Encode and Decode toggles.

2

Paste Your HTML or Text

Paste the string you want to encode (raw HTML you need to show as text) or decode (entity-laden content you need to render).

3

Select Mode

Pick Encode to convert special chars to entities, or Decode to convert entities back to their raw characters.

4

Read the Result

Encoded or decoded output appears instantly in the adjacent pane — long input is scrollable and wraps by default.

5

Copy the Result

Click Copy to grab the output. Paste into your documentation, code sample, or user-facing page to render safely.

Llest per provar-ho? HTML Entity Encoder?

Instal·la DevSuite Pro gratuïtament i desbloqueja més de 39 eines de desenvolupador per al teu navegador.

Afegeix a Chrome Afegeix a Edge Afegeix a FireFox