工具 指南
Security 免费 无需注册

HTML Sanitizer

Clean HTML and remove XSS / dangerous code

正在加载工具…

关于此工具

Paste HTML containing potentially dangerous tags or attributes and get a safe, sanitized version back instantly. The sanitizer strips <script>, <iframe>, <object>, and <embed> tags, removes all on* event handlers, rewrites javascript: URLs, and highlights exactly what was removed so you can see every change. Advanced options let you allow or block specific tags and choose between full sanitization or 'text only' mode that strips all markup.

使用方法

  1. 1 Paste your HTML into the input area on the left.
  2. 2 The sanitized output appears on the right in real time.
  3. 3 Removed or modified nodes are highlighted in red in the diff view.
  4. 4 Use 'Allow tags' or 'Block tags' to tune the rules.
  5. 5 Toggle 'Strip all tags' to extract plain text only.
  6. 6 Click 'Copy Output' to copy the sanitized HTML.

常见问题

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}