首页Home › 开发工具Developer Tools

🧽 HTML 过滤工具HTML Filter / Cleaner

按需去除 HTML 中的 script、style、注释、事件属性(onclick 等)、javascript: 链接、指定标签或所有标签,基于浏览器 HTML 解析器清理。Strip script, style, comments, event handlers (onclick…), javascript: URLs, specific tags or all tags from HTML, using the browser's HTML parser.

使用说明与常见问题How-to & FAQ

「HTML 过滤工具」是什么?What is the HTML Filter / Cleaner tool?

按需去除 HTML 中的 script、style、注释、事件属性(onclick 等)、javascript: 链接、指定标签或所有标签,基于浏览器 HTML 解析器清理。Strip script, style, comments, event handlers (onclick…), javascript: URLs, specific tags or all tags from HTML, using the browser's HTML parser.

如何使用「HTML 过滤工具」?How do I use the HTML Filter / Cleaner tool?

在「HTML 过滤工具」中,把内容粘贴或输入到上方输入框,按需设置「额外去除标签」,结果会实时显示在下方,点击「复制结果」即可复制。In the HTML Filter / Cleaner: Paste or type into the input box, adjust "Extra tags to remove"; the result appears below instantly — click "Copy result" to copy it.

能保证防住所有 XSS 吗?Does it guarantee XSS-safe output?

它用浏览器自身的 HTML 解析器处理(可正确处理未闭合、嵌套的标签),默认会去掉 script、事件属性、javascript: 链接和 iframe/object/embed。它适合清理内容,但不能替代服务端的白名单过滤;生产环境请在服务器端再用 DOMPurify 等库过滤。输出会按标准 HTML 重新序列化(如补全闭合标签、转义 < >)。It uses the browser's own HTML parser (so unclosed and nested tags are handled) and by default removes scripts, event handlers, javascript: URLs and iframe/object/embed. It is good for cleaning content but is not a substitute for server-side allow-list sanitizing — use a library such as DOMPurify on the server in production. Output is re-serialized as standard HTML (closing tags added, < > escaped).

代码或数据会被上传吗?Is my code or data uploaded?

不会。「HTML 过滤工具」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The HTML Filter / Cleaner runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.

「HTML 过滤工具」免费吗?需要注册吗?Is the HTML Filter / Cleaner free? Do I need an account?

「HTML 过滤工具」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The HTML Filter / Cleaner is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.

相关工具Related tools

🧩 正则生成多语言代码Regex Code Generator💠 JSON 转 C# 实体类JSON to C# Class☕ JSON 转 Java 实体类JSON to Java POJO🗃️ SQL 建表语句转 Java 实体类SQL (CREATE TABLE) to Java Entity🌲 JSON 可视化树形查看器JSON Tree Viewer🧭 XPath 在线测试XPath Tester🔁 htaccess 转 Nginx 规则htaccess to Nginx Converter⌨️ 键盘测试工具Keyboard Tester🟨 JS 格式化/压缩JavaScript Beautifier & Minifier🛡️ JS 混淆加密JavaScript Obfuscator📦 JS eval 解包JavaScript Unpacker📊 Excel 转 JSONExcel to JSON

← 全部工具All tools