跳转到主要内容
CuteJSON
↑↓ 导航 Enter 选择 Esc 关闭

JSON Escape and Unescape

Turn a JSON document into a string you can paste inside another document, or read an escaped string back into the text it stands for.

返回所有工具

键盘快捷键

这些快捷键在页面上对应操作存在时有效。

打开命令面板
Ctrl/Cmd + K
运行主要操作
Ctrl/Cmd + Enter
格式化
Ctrl/Cmd + Shift + F
压缩
Ctrl/Cmd + Shift + M
复制输出
Ctrl/Cmd + Shift + C
打开文件
Ctrl/Cmd + Shift + O
下载输出
Ctrl/Cmd + S
关闭此对话框
Esc
打开此对话框
F1 / ?

本地数据

以下所有内容仅存储在此浏览器、此设备上。

未保存的草稿
记住选项的工具

最近打开的文件

    此设备上尚未打开任何文件。

    通过链接分享

    内容被打包在链接 # 号之后的部分。

    分享此页面上的第一个输入。

    暂无可分享的内容。

    Text

    从 URL 加载

    直接从浏览器获取 URL。

    Escaped

    结果将显示在此处。

    完全在您的浏览器中运行。

    关于此工具

    Escaping is what a document needs before it can live inside a string: a JSON value holding another JSON document, a log line, a shell argument, a fixture pasted into a test. The rules are short and all of them are here. The characters with a short escape get it, control characters that have no short form become a \u escape, and a forward slash is left alone, because JSON accepts \/ and nothing requires it. Optionally everything above ASCII becomes a \u escape as well, which is what you want when the text has to cross something that is not certainly UTF-8. Neither direction requires valid JSON, since escaping part of a document is an ordinary thing to want, and the page says separately whether the result happens to parse.

    使用方法

    1. Choose Escape or Unescape, then paste your text into the left pane.
    2. When escaping, decide whether to wrap the result in quotes and whether to escape everything above ASCII.
    3. Press Convert, then copy the result. A bad escape is reported with the line and column it sits on.