JSON Syntax
Can json use single quotes?
No, valid JSON does not support single quotes for strings. The JSON specification strictly requires double quotes for both object keys and string values. Using single quotes will result in a parsing error in standard JSON parsers. This differs from JavaScript, which accepts both single and double quotes interchangeably. The strict double-quote requirement ensures consistency and simplifies parsing across different platforms and languages. If you have data with single quotes, you must convert them to double quotes before it can be parsed as valid JSON. Some JavaScript-specific parsers may accept single quotes, but this creates non-standard JSON that will fail in other environments. Always use double quotes to ensure maximum compatibility.
Last updated: December 23, 2025
Related Questions
Can json have duplicate keys?
Learn whether JSON can have duplicate keys, what happens when they occur, and why you should avoid them for data integrity and predictability.
Can json have comments?
Learn whether JSON supports comments and discover workarounds. Understand why standard JSON excludes comments and alternatives like JSON5.
Can json start with array?
Discover if JSON can start with an array. Learn about valid JSON structures, top-level arrays, and when to use them in your APIs.
Still have questions?
Can't find the answer you're looking for? Please reach out to our support team.