跳到正文Skip to content

HTML 转义HTML Escape / Unescape

转义或还原 HTML 里的特殊字符(< > & 引号等)。Escape or unescape special characters in HTML text and attributes.

理念:Idea: 代码原样展示,不再显示错乱。Show code exactly as written.

解决:Solves: 特殊字符转义,避免显示错乱Escapes special characters so they display

适合:For: 写网页、发代码片段的人Web authors sharing code

可用Available在浏览器中运行Runs in your browser
Loading tool…

在你的设备上本地处理。这里输入的内容不会上传。Processed locally on your device. Nothing you enter here is uploaded.

使用方法How to use

  1. 1粘贴文本。Paste text.
  2. 2选择「转义」或「还原」。Choose Escape or Unescape.
  3. 3复制结果。Copy the result.

说明Good to know

  • 转义处理 & < > ,可选同时处理引号;还原支持数字实体和常见命名实体(&amp; &nbsp; &copy; 等),不认识的原样保留。Escape handles & < > and, optionally, quotes. Unescape understands numeric entities and the common named ones (&amp; &nbsp; &copy; …); unknown names are left as they are.
  • 转义用于把文字安全放进 HTML,并不是对不可信网页代码的完整安全过滤。Escaping is for putting text safely into HTML. It is not a full security filter for untrusted markup.
  • Base64 编解码Base64 Encoder / Decoder

    文本与 Base64 互转,完整支持 UTF-8 与中文。Encode text to Base64 and decode it back, with full UTF-8 support.

    可用Available开发者工具Developer
  • Hash 计算Hash Generator

    计算文本的 SHA-1、SHA-256、SHA-384、SHA-512 值。Compute SHA-1, SHA-256, SHA-384 and SHA-512 of any text.

    可用Available开发者工具Developer
  • 正则表达式测试Regex Tester

    用示例文本测试 JavaScript 正则,实时高亮匹配并显示分组。Test a JavaScript regular expression on sample text with live highlighting and capture groups.

    可用Available开发者工具Developer