JSON 转义 / 反转义
将文本转义为有效的 JSON 字符串字面量,或对已转义的 JSON 字符串进行反转义。
输入
结果
使用方法
Escaping text
Escape turns raw text into a JSON safe literal. Unescape converts a literal back to readable text.
- Paste the text or literal.
- Choose Escape or Unescape.
- Copy the result.
常见问题
Which characters are escaped?
Quotes, backslashes, control characters and newlines are escaped according to the JSON specification.
Does it add surrounding quotes?
Yes, escaping produces a complete string literal including the surrounding quotes.