csvjson

HTML Entity Encode / Decode

Encode HTML special characters to entities or decode entities back to text. Handles named, decimal, and hex entities.

🔧

HTML Entities is coming soon. In the meantime, try the JSON → CSV converter, which has flattening built in.

How it works

Named + numeric entity support

Encodes 28 named entities (&, <, ©, €…) and converts any non-ASCII character to a numeric entity. Decodes named, decimal (<), and hex (<) entities on input.

Example

Encoding HTML tags for safe display in a code block

Input
<script>alert("XSS")</script>
Output
&lt;script&gt;alert(&quot;XSS&quot;)&lt;/script&gt;

Encoded output renders as literal text — the script is displayed, not executed.

Frequently asked questions

Which characters must be HTML-encoded?

Minimum required: & → &amp;, < → &lt;, > → &gt;. In attribute values: " → &quot;. Non-ASCII characters are optional in UTF-8 documents.