JSON QuickFix › Convert single quotes to double quotes in JSON

Convert single quotes to double quotes in JSON

JSON only accepts double-quoted strings, so {'id': 'a1'} fails to parse. Paste it below and press Quick Fix to convert every single-quoted key and string to double quotes. Apostrophes and quotes inside the text are escaped for you.

Input

Paste some JSON, drop a .json file, or load the sample to get started.
Advertisement

Why single quotes are invalid

The JSON standard defines a string as text inside double quotes. Single quotes are common in JavaScript object literals, Python output and hand-written config, but a strict JSON parser treats ' as an unexpected character.

Why find-and-replace is risky

Replacing every ' with " breaks text that contains apostrophes ('it's') or double quotes. Quick Fix reads the input token by token instead: it converts only the quotes that delimit strings, escapes any " inside them, and turns \' back into a plain apostrophe.

Error messages you might see

  • Expected property name or '}' in JSON at position 1 (Chrome / Edge / Node.js, quoted key)
  • Unexpected token ''', ... is not valid JSON (Chrome / Node.js, quoted value)
  • JSON.parse: expected property name or '}' (Firefox)
  • Expecting property name enclosed in double quotes (Python)
Advertisement

Frequently asked questions

Can JSON use single quotes?

No. Standard JSON requires double quotes around every key and string value. Some lenient formats such as JSON5 accept single quotes, but JSON.parse and most APIs do not.

What happens to apostrophes inside my text?

They are kept. Quick Fix only changes the quotes that start and end a string, so a value like It's fine stays exactly the same.

Does it handle curly “smart” quotes too?

Yes. Curly quotes pasted from word processors or chat apps are replaced with straight double quotes as well.