Unescaped Quotes in JSON – Escape Double Quotes Correctly

Local only

A double quote ends a JSON string unless it is escaped. Quotation marks that belong inside the value must be written as \" in raw JSON text.

Indent

36 chars · 3 lines

Two-way sync · Edit either side and the other updates automatically.

Invalid JSONExpected ',' or '}' after property value
Line 2Column 25Character 27Found “h”
"message": "She said "hello"."

JSON quotation error

How embedded quotes end a JSON string too early

When a raw double quote appears inside a quoted JSON value, the parser treats it as the end of that value. The following text then appears in a place where the object grammar expects a comma or closing delimiter. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • Browser-local JSON processing
  • Route-specific malformed JSON example
  • Focused parser or repair guidance
  • Broken and corrected JSON example
  • Related JSON problem navigation

Steps

  1. Find the quote that should be part of the string rather than its closing delimiter.
  2. Prefix embedded quotation marks with one JSON backslash in the raw document.
  3. Validate the complete string to make sure the intended final quote remains unescaped.

Only quotes inside the value need escaping

The opening and closing delimiters remain plain double quotes. Extra escaping on the final delimiter can create an unterminated string, so inspect the exact intended text boundary.

  • Dialogue or quoted titles inside a string value.
  • HTML or command snippets containing double quotes.
  • Manually assembled JSON strings without a serializer.

Prefer serialization over manual concatenation

If the source value already exists as a normal application string, pass it to a JSON serializer. Manual escaping is easiest to get wrong when data contains both quotes and backslashes.

Unescaped quote example

The inner hello quotation marks must be escaped while the outer JSON string delimiters remain plain.

Invalid quoted text

{
  "message": "She said "hello"."
}

Valid escaped quotes

{
  "message": "She said \"hello\"."
}

Common questions

Frequently asked questions

How do I put double quotes inside a JSON string?

Escape each embedded double quote as \" in the raw JSON text while leaving the string's opening and closing quotes unescaped.

Can I use single quotes around the outer JSON string instead?

No. Standard JSON strings and property names use double quotes. Single quotes are JavaScript syntax, not JSON syntax.

Why does the parser error appear after the quote?

The parser may believe the string ended successfully, then fail only when the next word or quote cannot legally follow a completed value.

Debugging a specific JSON issue? Browse JSON troubleshooting.