JSON Escape & Unescape
Escape or unescape strings for code, logs, and API payloads.
- 100% client-side · your data never leaves your browser
- Instant, no rate limits
- Free, no sign-up
Your result appears here
Paste your data into the panel on the left — everything runs privately in your browser.
Overview
JSON Escape & Unescape — Escape Strings Online
Escape any text so it can be safely embedded inside a JSON string, a log line, or a code literal — or unescape sequences like \n, \t, and \" back into readable text. Escaping is essential whenever you copy values between APIs, SQL, JavaScript, and configuration files, where unescaped quotes and newlines silently break parsing. Convert in both directions instantly, fully in your browser.
Escape vs unescape
Escape converts raw text into a JSON-safe form: double quotes become \", backslashes become \\, and control characters such as newlines and tabs become \n and \t. The output is the escaped content only, without surrounding quotes, so you can drop it straight into an existing string.
Unescape reverses the process. Paste an escaped fragment pulled from a log file, a stack trace, or generated code, and get the original human-readable text back — useful for reading error payloads that were double-encoded.
Why escaping matters
- Embedding a JSON document inside another JSON string (double-encoding)
- Storing multi-line text or HTML in a single JSON field
- Pasting API values into SQL, shell, or source code without breakage
- Reading escaped log entries and webhook payloads back into plain text
Common escape sequences
JSON defines a small set of escapes: \" (quote), \\ (backslash), \/ (optional solidus), \n (newline), \r (carriage return), \t (tab), \b (backspace), \f (form feed), and \uXXXX (Unicode code point). Any character outside the printable ASCII range can be represented with a \u escape, which is how non-Latin text survives systems that are not UTF-8 clean.
FAQ
Frequently asked questions
Does escaping add surrounding quotes?
No. The output is the escaped content only, without wrapping quotes, so you can paste it directly into an existing JSON string.
What is double-escaping?
Double-escaping happens when already-escaped text is escaped again, turning \n into \\n. It is common when JSON is nested inside JSON. Unescape once per layer of encoding to recover the original.
Does it handle Unicode?
Yes. Characters can be escaped to \uXXXX form and unescaped back. Emoji and non-Latin scripts round-trip correctly.
Is this the same as URL encoding?
No. JSON escaping and URL (percent) encoding use different rules. For URLs, use the URL Encode / Decode tool instead.
Continue with a related tool
All tools- JSON Base64 Encode & Decode
Encode text or JSON to Base64 and decode Base64 back to readable text.
- JSON Editor
Write, edit, format, minify, and validate JSON in a fast full-screen or embedded editor.
- JSON Flattener
Flatten nested JSON into a single-level object with dot or underscore keys.
- JSON Formatter & Beautifier
Format, prettify, and beautify messy JSON with configurable indentation and key sorting.
- JSON Key Sorter
Sort object keys alphabetically — recursively for stable, readable JSON.
- JSON Merge Tool
Deep-merge two JSON objects — nested keys combine, arrays and scalars override.