Quick answer

In JSON, string values and keys must use double quotes.

JSON Single Quotes Not Allowed

In JSON, string values and keys must use double quotes. Single quotes are not valid for delimiting strings.

Common causes

How to fix

JSON single quotes are not allowed because JSON syntax requires double quotes around both object keys and string values. If you paste JavaScript-style objects, Python dictionaries, or loosely formatted configuration into a JSON parser, this validator helps you identify the quoting issue quickly and correct it before the data is used in APIs, web apps, logs, or configuration files. Developers, QA teams, data engineers, and integrators use this check to catch invalid payloads early and avoid parse failures in downstream systems.

How This Validator Works

This validator checks whether your input follows JSON string and key quoting rules defined by the JSON format. It looks for single-quoted keys or values, which are valid in some programming languages but not in strict JSON. When it finds a mismatch, it flags the syntax error so you can replace single quotes with double quotes and re-test the payload.

Common Validation Errors

Single-quote errors usually happen when content is copied from code examples, server logs, or language-specific data structures. JSON is strict, so even a small quoting difference can make the entire document invalid.

Where This Validator Is Commonly Used

Quote validation is commonly used anywhere JSON is exchanged, stored, or parsed. It is especially useful when data moves between systems that enforce strict syntax rules.

Why Validation Matters

Invalid JSON can break API calls, stop configuration from loading, and cause parsing errors in applications that expect strict syntax. Validating quote usage helps teams catch issues before deployment, reduce debugging time, and keep data exchange predictable across systems. It also improves reliability when JSON is generated by templates, copied from examples, or assembled dynamically.

Technical Details

JSON syntax is defined by RFC 8259, which requires double quotes for all string literals and object member names. Single quotes are not part of the JSON specification, even though they may appear in JavaScript, Python, or other languages. A strict JSON parser will reject them.

FAQ

Why are single quotes not allowed in JSON?

JSON uses a strict syntax standard that requires double quotes for strings and object keys. Single quotes are common in other languages and examples, but they are not valid JSON. This rule helps keep data format behavior consistent across parsers, APIs, and programming environments.

Is {'name': 'Alice'} valid JSON?

No. That format looks like a Python dictionary or a loosely written object literal, but it is not valid JSON. In JSON, it must be written as {"name": "Alice"} with double quotes around both the key and the value.

Can I use single quotes if the parser accepts them?

Some tools may be lenient and accept non-standard input, but strict JSON parsers will reject single quotes. If your data is meant to be exchanged as JSON, it is best to follow the specification and use double quotes everywhere.

What is the difference between JSON and JavaScript objects?

JavaScript object literals can use unquoted keys in some cases and may allow single-quoted strings, but JSON does not. JSON is a data interchange format with stricter rules, so code that works in JavaScript may still fail as JSON.

How do I fix single-quote JSON errors quickly?

Replace every single-quoted key and string value with double quotes, then re-check the document. Make sure the result still follows JSON rules for commas, brackets, braces, booleans, null values, and escaped characters.

Does this validator check other JSON syntax issues?

This page focuses on quote-related JSON errors. Other validators may be better suited for missing commas, trailing commas, invalid escape sequences, or malformed brackets. Use a dedicated JSON validator for full syntax checking.

Why does copied code often fail as JSON?

Code snippets are often written in JavaScript, Python, or documentation-friendly formats that are not strict JSON. When copied into an API body or configuration field, those differences can trigger parse errors, especially around quote style and key formatting.

Can apostrophes appear inside JSON strings?

Yes. Apostrophes can appear inside a JSON string as regular characters, as long as the string itself is wrapped in double quotes. For example, {"message": "It's valid JSON"} is correct.

Related Validators & Checkers

FAQ

Can I use single quotes in JSON?
No. The JSON spec allows only double quotes for strings.
What if my string contains double quotes?
Escape them: \" inside the string.

Fix it now

Try in validator (prefill this example)

Related

All tools · Canonical