转义 JSON 字符串中的特殊字符。将 JSON 数据转换为正确的转义格式,以便安全传输或存储。
Input JSON
Escaped JSON
工具选项
Quote Output
Add double quotes around the output JSON data.
转义 JSON 示例
点击尝试!
In this example, we escape all quotes (") around the keys and values in a simple JSON object. This ensures that the JSON data is interpreted correctly if it's used in another JSON object or assigned to a variable as a string.
Quote Output
Add double quotes around the output JSON data.
In this example, we escape a more complex JSON object with nested elements containing data about the Margherita pizza recipe. We escape all quotes within the object as well as convert all line breaks into special " " characters. Additionally, we wrap the entire output in double quotes by enabling the "Wrap Output in Quotes" option.
Quote Output
Add double quotes around the output JSON data.
This example showcases that escaping isn't necessary for JSON arrays containing only numbers. Since numbers themselves don't hold special meaning in JSON, the tool doesn't modify the input and the output remains the same as the original JSON array.
Quote Output
Add double quotes around the output JSON data.