JSON Double Quote Converter

The inverse of the single-quote converter: takes single-quoted JS-object-literal-like text (where a double quote may legitimately appear inside string content) and converts it back to valid double-quoted JSON by swapping delimiter quotes, then validates the result with JSON.parse and re-serializes it pretty-printed. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-24

Overview

Introduction

Single-quoted object literals are common in hand-written JS code and Python-style dict notation, but neither is valid JSON on its own.

This tool converts that single-quoted style back into strict, parseable double-quoted JSON, handling any double quotes nested inside string content along the way.

What Is JSON Double Quote Converter?

A quote-delimiter converter that scans single-quoted text character by character, swaps each string's delimiter to a double quote, escapes any literal double quote found inside the content, and un-escapes any now-unnecessary \' sequence.

It's the single-to-double half of a matched pair with JSON Single Quote Converter, which performs the inverse conversion starting from valid JSON.

How JSON Double Quote Converter Works

The tool scans the raw input character by character; whenever it encounters a ', it reads the string's content up to the matching closing ' (honoring backslash escapes), converts any \' to a plain ', escapes any literal " to \", and re-emits the string delimited by double quotes.

Once the whole text has been converted, the result is passed to JSON.parse to validate it; on success it's re-serialized with JSON.stringify(parsed, null, 2), and on failure the underlying parse error is returned directly.

When To Use JSON Double Quote Converter

Use it when you've copied single-quoted JS object literal syntax (or a Python dict) and need strict, valid JSON out the other end.

It's also useful as the second half of a round trip after using JSON Single Quote Converter to edit something in single-quoted form.

Features

Advantages

  • Correctly handles double quotes embedded inside single-quoted string content without breaking the conversion.
  • Validates the converted result with a real JSON.parse rather than assuming the conversion succeeded.
  • Predictable and narrowly scoped, unlike the broader heuristic repair in Fix JSON Quotes.

Limitations

  • It assumes the input is consistently single-quoted; it doesn't handle unquoted keys or curly smart quotes the way Fix JSON Quotes does.
  • If the underlying structure is broken (mismatched brackets, trailing commas), conversion succeeds but the final JSON.parse still fails with a structural error.

Examples

Converting single-quoted text to valid JSON

Input

{'name': 'Ada', 'note': 'say "hi"'}

Output

{
  "name": "Ada",
  "note": "say \"hi\""
}

Both quote delimiters switch from ' to ", and the double quotes already inside the note string's content get escaped so they don't break the new delimiter.

Best Practices & Notes

Best Practices

  • Use this when you know the input is consistently single-quoted; for messier input with mixed quote styles or unquoted keys, use Fix JSON Quotes instead.
  • Validate the result with JSON Validator afterward if you need extra confidence beyond the built-in parse check.
  • Pair with JSON Single Quote Converter to round-trip content between the two quote styles as needed.

Developer Notes

The character scan treats every ' outside of already-processed strings as a new string's opening delimiter, mirroring the same escape-aware scanning approach used in json-single-quote-converter.ts and fix-json-quotes.ts, so all three quote-handling tools in this batch share one consistent mental model even though each has a narrower or broader scope.

JSON Double Quote Converter Use Cases

  • Converting a hand-written single-quoted JS object literal into valid JSON for an API request body
  • Turning a copied Python dict literal into valid JSON
  • Completing a round trip after editing content in single-quoted form with JSON Single Quote Converter

Common Mistakes

  • Feeding in text with unquoted keys and expecting it to convert cleanly; this tool only swaps quote delimiters, it doesn't add missing quotes around keys.
  • Assuming any conversion failure is a quote issue; check the reported parse error, since it may point to an unrelated structural problem instead.

Tips

  • If conversion fails, try Fix JSON Quotes instead, it also handles unquoted keys and curly smart quotes that this narrower tool doesn't.
  • Use this as the last step after hand-editing single-quoted JS object literal content, right before sending it to a system that requires strict JSON.

References

Frequently Asked Questions