Blog
Wild & Free Tools

Escape Double Quotes in JSON — Free Online Tool

Last updated: January 2026 5 min read
Quick Answer

Table of Contents

  1. The Quote Escape Rule
  2. When You Need to Escape Twice
  3. Different Layers, Different Rules
  4. Why Manual Escaping Goes Wrong
  5. Frequently Asked Questions

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 Shipping

Different Layers Have Different Rules

JSON's quote escape is a backslash. Other systems that wrap your JSON have their own rules:

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 Tool

Frequently 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.

Jake Morrison
Jake Morrison Security & Systems Engineer

Jake's conviction that files should never touch a third-party server is the foundation of WildandFree's zero-upload design.

More articles by Jake →
Launch Your Own Clothing Brand — No Inventory, No Risk