Developer
JSON Quotes and Backslashes: Common Syntax Fixes
Many JSON errors come from strings: single quotes, unescaped double quotes, Windows paths, or backslashes that were copied from another source.
Use the free JSON FormatterUse double quotes
JSON requires double quotes around object keys and string values. Single quotes may work in JavaScript code, but they are not valid JSON.
Escape quotes inside strings
If a string contains a double quote, escape it with a backslash so the parser does not treat it as the end of the string.
Check backslashes carefully
Backslashes introduce escape sequences. File paths and regular expressions often need extra care before they are valid JSON strings.
FAQ
Can JSON use single quotes?
No. Standard JSON uses double quotes for strings and object keys.
How do I include a quote inside a JSON string?
Escape the inner quote with a backslash.
Why do Windows paths break JSON?
Backslashes can be treated as escape characters unless they are written correctly.