JSON 字符串转义 / 反转义 — Uttir
Skip to main content

JSON 字符串转义 / 反转义

将字符串转义后安全嵌入 JSON 文档(处理引号、反斜杠和控制字符),或将 JSON 编码的字符串字面量还原为原始形式。

JSON 字符串转义 / 反转义 — JSON strings must escape a small set of characters: the double quote, the backslash, and the control characters (U+0000 to U+001F). Everything else may appear literally.

Pure function, no upload, no server. Works fully offline.

Was JSON 字符串转义 / 反转义 useful?

JSON 字符串转义 / 反转义是什么?

JSON strings must escape a small set of characters: the double quote, the backslash, and the control characters (U+0000 to U+001F). Everything else may appear literally.

This tool implements the standard JSON escaping rules from RFC 8259. The "escape" direction converts a raw string into a JSON-safe form (the content you would put between double quotes). The "unescape" direction parses a JSON string literal back to its raw bytes.

使用方法

  1. Pick the direction

    Escape raw → JSON or Unescape JSON → raw. Both directions round-trip cleanly for any valid input.

  2. Paste the input

    For escape, paste any string (control characters allowed). For unescape, paste the JSON-quoted content (without the surrounding quotes).

  3. Copy the output

    Use the escaped form inside a JSON config or template. Use the raw form to inspect what a stored string actually contains.

常见问题

相关工具

Last reviewed: 2026-11-21