Escape Double Quotes in JSON — Free Online Tool
- Paste JSON with quotes; get back a string with every double quote properly escaped.
- Works for embedding JSON inside another JSON string, a SQL value, or a shell argument.
- Runs in your browser — your data never gets uploaded.
Table of Contents
Double quotes inside a JSON string need a backslash in front of them. Forget one and the JSON parser stops at the unescaped quote, treating everything after as a syntax error. The fix is mechanical: walk the string, prepend a backslash to every ". Doing it by hand for anything longer than a few characters is error-prone — paste it into the tool instead.
The Double Quote Escape Rule
JSON strings are bounded by double quotes. Any double quote inside the string must be escaped with a backslash, otherwise the parser thinks the string ended early.
Raw input:
She said "hello"
Inside a JSON string:
"She said \"hello\""
The outer pair are the string boundaries; the inner pair are escaped so the parser doesn't terminate the string at "She said ". This is the most common JSON escape problem because it shows up the moment a string contains any quoted text.
When You Need to Escape Twice (or Three Times)
If a JSON string is going to live inside another JSON string, every quote needs to be escaped at each layer. One backslash for the inner JSON, two backslashes for the outer JSON, four for the third level.
Example: a webhook payload that contains a JSON config field as a string:
// The inner config you want to send:
{"name": "test"}
// Wrapped as a string inside an outer JSON:
{"config": "{\"name\": \"test\"}"}
// If the outer JSON is then embedded inside yet another JSON:
{"webhook": "{\"config\": \"{\\\"name\\\": \\\"test\\\"}\"}"}
The escape count doubles at each layer. After two layers it's hard to read; after three it's impossible to write by hand. Paste the inner JSON into the escape tool and run it twice (or three times) — once per nesting level.
Sell Custom Apparel — We Handle Printing & Free ShippingDifferent Layers Have Different Rules
JSON's quote escape is a backslash. Other systems that wrap your JSON have their own rules:
- SQL strings: Most dialects double the quote (
'O''Brien') or use a different delimiter. JSON quotes don't need SQL escaping unless they're at the SQL layer. - Shell single-quoted strings: No escapes inside single quotes. To include a single quote, you have to break out:
'don'\''t'. - Shell double-quoted strings: Use
\"to include a quote.\$for a dollar sign. Backticks need their own escape too. - HTML attributes: Use
"for a literal quote inside a double-quoted attribute value. - CSV fields: Wrap the field in double quotes and double any internal quote (
"She said ""hi""").
If your JSON is going through multiple layers — say, into a shell command that posts to a SQL-backed API — you need to apply each layer's escape rule in order. Get the JSON escape right first; handle the outer layers separately.
Why Manual Escape Almost Always Goes Wrong
Three failure modes show up over and over:
1. Missing one quote. A string with eight quotes needs eight backslashes. Skip one and the JSON breaks at that point with a confusing error message that points to a column far from the actual problem.
2. Escaping the wrong way. Some people reflexively use \' for single quotes (which JSON doesn't support — single quotes don't need escaping) or \" for both inner and outer quotes (breaking the string boundaries).
3. Editor auto-escaping. Some IDEs auto-escape when you paste, others don't. Pasting a quoted string into a JSON file in VSCode, then again in IntelliJ, can give you different results. Use a deterministic tool instead of trusting the editor.
The tool sidesteps all three. Paste once, get the escaped string, paste it where it needs to go.
Escape Your Quotes
Paste once, get every double quote escaped. Free, browser-based.
Open Free JSON Escape / Unescape ToolFrequently Asked Questions
Why doesn't JSON support single quotes?
The JSON spec requires strings be wrapped in double quotes. Single quotes inside a string are allowed without escaping; single quotes as string delimiters are not.
Does JSON.stringify escape forward slashes?
No — forward slashes are not required to be escaped by the JSON spec. Some implementations escape them as \/ for HTML safety, but most do not.
How do I escape a quote inside a quote inside a quote?
Each nesting layer doubles the escape count. One layer: \". Two layers: \\". Three: \\\\\". Use the tool repeatedly per layer.
Will this tool handle JSON with newlines inside strings?
Yes. Newlines inside JSON strings get escaped as \n. The tool handles this along with quotes, tabs, and other control characters.

