HTML字符转义
HTML 实体的转义与反转义。
关于「HTML字符转义」
它属于「编码加密」分类:常见编码、哈希与转义,全部在本地计算。
- 把 < > & " ' 转成 HTML 实体,防止在网页中被当作标签解析。
- 反转义把实体还原为原始字符,便于阅读源码。
- 处理在本地完成,内容不会上传。
完全免费、无需注册;所有处理都在浏览器本地完成,文件不会上传到任何服务器。
相关关键词:HTML字符转义、编码加密、html、实体、escape、在线工具、免费
如何使用「HTML字符转义」
- 打开工具:打开「HTML字符转义」页面,无需注册、无需安装任何软件。
- 准备输入:准备好要处理的内容或文件:文本可直接粘贴,文件可拖入页面(本工具属于「编码加密」)。
- 填入内容:把内容粘贴进输入框,或把文件拖入页面;也可以点击「示例」先填入样例数据试一下。
- 设置选项并处理:按需调整页面上的选项,然后点击处理 / 转换 / 生成按钮。
- 获取结果:处理完全在浏览器本地完成,结果可直接复制或下载,文件不会上传到任何服务器。
常见问题
- 什么时候需要转义?
- 把不可信文本插入 HTML 时转义可避免 XSS;展示用户输入内容时尤其重要。
- & 没被转义?
- 通常只转 & 为 &;若已写成实体则不会被二次转义。
HTML Escape (English)
Escape and unescape HTML entities.
Belongs to “Encoding & Crypto”: Common encodings, hashes and escaping — all computed locally.
- Turns < > & " ' into HTML entities so they are not parsed as tags.
- Unescape restores entities to the original characters for readable source.
- Processing is done locally; nothing is uploaded.
Free, no sign-up; everything runs locally in your browser and files are never uploaded.
Keywords: HTML Escape, Encoding & Crypto, html, entity, escape, online tool, free
How to use it
- Open the tool:Open the “HTML Escape” page — no sign-up and nothing to install.
- Prepare the input:Prepare the content or file to process: paste text or drop a file onto the page (this tool belongs to “Encoding & Crypto”).
- Provide the input:Paste your content into the input box or drop a file onto the page; you can also click “Sample” to try example data first.
- Adjust options and run:Adjust the options if needed, then click the process / convert / generate button.
- Get the result:Everything runs locally in your browser; copy or download the result — your files are never uploaded.
FAQ
- When is escaping needed?
- Escaping untrusted text before inserting it into HTML prevents XSS; it matters most when showing user input.
- Why wasn’t & escaped?
- Usually only & becomes &; if it is already an entity it won’t be escaped again.
More tools in Encoding & Crypto
- Base64 Encode/Decode — Convert text to/from Base64, plus file to Base64.
- URL Encode/Decode — encodeURIComponent-level escaping and unescaping.
- Hash Calculator — Compute SHA-1/256/384/512 of text or files.
- MD5 Hash — Pure front-end MD5 digest computation.
- Morse Code — Convert text to/from Morse code, with beep playback.
- Radix Converter — Convert numbers between any bases 2–36.
- Unicode Converter — Convert Chinese to/from \u escape sequences.
- JWT Decoder — Decode JWT header and payload, show expiry.
- Random Password Generator — CSPRNG-based strong passwords, batch supported.
- Password Entropy — Estimate password strength and brute-force time.
- UUID Generator — Batch-generate v4 UUIDs, optional upper-case and no dashes.