๐Ÿท๏ธ
๐Ÿงผ

Sanitise User Input for HTML Output

Encode user-provided strings before inserting them into HTML โ€” prevents XSS injection attacks.

Tiada log masuk diperlukan
Output:
Examples:
Plain text / HTML
Encoded HTML
Output will appear hereโ€ฆ
Common HTML entities reference
&&
<&lt;
>&gt;
"&quot;
'&#39;
ยท&nbsp;
ยฉ&copy;
ยฎ&reg;
โ„ข&trade;
โ‚ฌ&euro;
โ€”&mdash;
โ€ฆ&hellip;

Security tips

๐Ÿงผ

Paste any user input here to see exactly which characters get encoded. < becomes &lt;, > becomes &gt;, & becomes &amp; โ€” all rendered as text, not HTML.

๐Ÿ›ก๏ธ

Cross-Site Scripting (XSS) attacks inject <script> tags via user input fields. Encoding all user output is the primary defense.

๐Ÿ’ก

Always encode on output (when rendering), not on input (when saving). Store raw data, encode when displaying โ€” this avoids double-encoding bugs.

๐Ÿ”

Test with payloads like <script>alert(1)</script> and onmouseover="alert(1)" to verify your encoding catches all attack vectors.

Cara ia berfungsi

1
Masukkan
Enter your data into the tool above. Everything stays local to your browser.
2
Proses
The tool processes your data instantly in your browser using JavaScript. No server, no waiting.
3
Muat turun
Get your result instantly. Nothing is stored after you leave the page โ€” complete privacy.

Mengapa alat kami?

โœ“Percuma sepenuhnya โ€” tiada kos tersembunyi, selama-lamanya
โœ“Tiada akaun, e-mel atau log masuk diperlukan
โœ“Fail tidak pernah meninggalkan peranti anda
โœ“Tiada had saiz fail langsung
โœ“Tiada tera air pada sebarang output

Also check outโ€ฆ

Soalan lazim