๐Ÿท๏ธ
๐Ÿงผ

Sanitise User Input for HTML Output

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

Ez da saioa hasi behar
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.

Nola Funtzionatzen Du

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

Zergatik erabili gurea?

โœ“Erabat doakoa, ezkutuko kosturik, inoiz
โœ“Ez da konturik, posta elektronikorik edo saioa hasteko beharrik
โœ“Fitxategiak ez dira inoiz zure gailutik irteten
โœ“Ez dago fitxategien tamaina mugarik
โœ“Ez dago ur-markarik edozein irteeratan

Also check outโ€ฆ

Maiz egiten diren galderak