Escape raw text or JSON content into a JSON-safe string and unescape JSON string literals back to readable text. Handle quotes, backslashes, line breaks, tabs, control characters, and Unicode escapes directly in your browser.
Convert raw text or JSON content into a JSON-safe string representation with escaped quotes, backslashes, line breaks, tabs, and other required control characters.
Decode valid JSON string escape sequences such as \" , \\, \n, \t, \r, and \uXXXX back into readable text or JSON content.
Work with JSON stored inside another JSON string, log field, database column, environment variable, or API response. Review the escaping depth before applying the operation again.
Distinguish between escaping a string value and serializing an entire JSON document. The output mode should make clear whether surrounding JSON string quotes are included.
Copy the escaped or unescaped output to your clipboard for use in JSON payloads, code, logs, tests, configuration files, and debugging workflows.
Download the result as a plain text file when the escaped content is large or needs to be reused in another tool.
Move the output back into the input area to inspect the reverse operation. Repeated escaping increases the escaping depth, so use this only when another serialization layer is intentional.
Escaping and unescaping happen in your browser. The page does not require an account or upload the input to a remote service.
Paste raw text, a JSON string literal, escaped JSON from a log, or a field copied from an API response. Choose the operation that matches the current representation.
Use Escape to encode text for use inside a JSON string. Use Unescape to decode valid JSON escape sequences and recover the represented text.
Confirm whether the output should include the surrounding JSON string quotes or only return the inner escaped content. This distinction affects how the result is embedded.
If the input already contains sequences such as \\" or \\\\, it may be escaped more than once. Do not apply Escape repeatedly unless another JSON or string serialization layer is required.
Copy the processed result or download it as text. Test the output with the parser or programming language that will consume it.
Escape a JSON document so it can be stored as the value of another JSON string.
{"name":"Alice","message":"She said \"OK\"","path":"C:\\Users\\test"}"{\"name\":\"Alice\",\"message\":\"She said \\\"OK\\\"\",\"path\":\"C:\\\\Users\\\\test\"}"The output includes surrounding quotes because the entire JSON document is represented as one JSON string value. If your application expects only the inner content, use the output mode implemented by the page.
JSON string escaping converts text into a representation that can safely appear inside a JSON string. Double quotes, backslashes, and control characters have special meaning in JSON, so they must be represented with escape sequences when they occur as content.
For example, the text She said "hello" contains double quotes. As JSON string content, it can be represented as She said \"hello\". The escaping changes the representation, not the intended text.
Standard JSON defines a limited set of escape sequences for string values:
\": double quote\\: backslash\n: line feed\r: carriage return\t: horizontal tab\b: backspace\f: form feed\uXXXX: a Unicode escape using four hexadecimal digitsEscaping the forward slash as \/ is allowed but not generally required. JSON does not support every escape syntax accepted by programming languages, so sequences such as \a, \v, and \0 should not be assumed to be valid JSON escapes.
A raw text string and a complete JSON document are related but different inputs. If you want to embed a JSON document inside another JSON string, the document must become string content:
{"event":"created"}may become a JSON string literal similar to:
"{\"event\":\"created\"}"The outer quotes indicate that the entire document is now one JSON string value. If you only need the inner escaped content, the surrounding quotes may be omitted depending on the target context.
Nested JSON is common when one JSON field contains another JSON document as a string:
{"payload":"{\"id\":1,\"status\":\"ok\"}"}The outer document contains a string, and the string's content happens to be JSON text. To inspect the inner object, decode the string value and then parse the resulting JSON. Removing backslashes manually without respecting the serialization layers can corrupt the data.
When writing application code, prefer the standard JSON library instead of manually replacing characters. In JavaScript, JSON.stringify(value) produces a JSON representation with the required escaping, and JSON.parse(text) parses JSON and decodes valid string escapes. Similar standard-library functions exist in Python, Java, C#, Go, and other languages.
An online escape tool is useful for inspection and one-off transformations, but application code should rely on a tested serializer and parser.
JSON escaping and HTML encoding target different contexts. JSON uses backslash sequences inside string values, while HTML uses entities such as " and &. Escaping a value for JSON does not automatically make it safe for HTML, JavaScript, SQL, URLs, or shell commands.
Unicode characters can normally appear directly in JSON. A serializer may choose to leave them readable or emit Unicode escapes. Characters outside the Basic Multilingual Plane, including many emoji, may be represented using surrogate-pair escapes in UTF-16-based environments, so do not assume every visible character maps to one \uXXXX sequence.
This tool is designed to escape and unescape input in the browser rather than sending it to a remote service. That is convenient for development data, logs, and test fixtures, but it is not a secret-management system. Avoid entering credentials, access tokens, private keys, customer information, or confidential production logs into any online tool.