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.