VSM
VSM

JSON Escape / Unescape

Thêm hoặc bỏ characters thoát cho chuỗi JSON


        

JSON Escape / Unescape

The JSON Escape tool instantly escapes and unescapes JSON strings, converting raw text into a safely embeddable JSON string value or restoring the original text from an escaped JSON string. Special characters such as double quotes, backslashes, newlines, and control characters must be properly escaped to produce valid JSON — and this tool handles all of that automatically. Whether you are building API payloads, writing configuration files, or debugging JSON data, the JSON Escape tool eliminates syntax errors caused by improper escaping.

Benefits

This tool applies the full JSON string escaping rules defined in RFC 8259, so every special character is handled correctly without any manual effort.

  • Instant escape and unescape with no installation or sign-in required
  • Correctly handles backslashes, double quotes, newlines, tabs, carriage returns, and Unicode control characters
  • Prevents JSON parse errors caused by unescaped or double-escaped characters
  • Works in both directions: escape raw text for JSON, or unescape a JSON string back to readable text

Use cases

The JSON Escape tool is useful whenever you need to embed arbitrary text inside a JSON string value or extract the original content from an escaped string.

  • Embedding error messages, HTML snippets, or multi-line content as a JSON string value
  • Preparing request bodies for REST APIs that require valid JSON payloads
  • Writing JSON config files that contain Windows file paths (backslashes) or regular expressions
  • Unescaping JSON string values to read the original content during debugging
  • Sanitizing user-submitted text before storing it as a JSON string

How to use

Paste your text or JSON string into the input field, choose the mode, and copy the result — the conversion is immediate.

  • Paste your raw text or escaped JSON string into the input box
  • Select Escape to produce a valid JSON string value, or Unescape to recover the original text
  • The converted output appears instantly in the result box
  • Click the copy button to send the result to your clipboard

Frequently asked questions

What characters does JSON Escape actually escape? It escapes double quotes ("), backslashes (\), and control characters including newline (\n), carriage return (\r), tab (\t), and other characters in the U+0000–U+001F range as required by the JSON specification.

Is JSON Escape the same as URL encoding or HTML escaping? No — JSON escaping, URL percent-encoding, and HTML entity encoding are three separate standards with different rules; using one in place of another will produce malformed output, so always use the right tool for the context.

Will this tool handle Unicode characters and emoji correctly? Yes, all Unicode characters including emoji and CJK characters are supported; they can be kept as-is (valid in JSON) or represented as \uXXXX sequences depending on your needs.

Can I use this to escape an entire JSON object as a string? Yes — if you need to embed a JSON object as a string value inside another JSON structure, paste the entire JSON object as the input and escape it; the output will be a valid JSON string representation of that object.