Publishers and typesetters use curly typographic quotes (“ “ ‘ ‘) because they read as polished, professional prose. Code, JSON, CSV, and shell commands need straight quotes ( “ ‘ ) because curly characters break string parsing. This converter goes both ways, so you can move text between a CMS and an editor without retyping.
How it works
Straight to smart scans each straight quote and decides opening versus closing from the character right before it. A double quote at the start of the text, or after whitespace or an opening bracket like (, [, {, becomes an opening ”; anything else becomes a closing ”. Single quotes follow the same rule for ’ and ’, with one extra step: an apostrophe that follows a letter or digit (such as the one in it’s) is always rendered as a closing ’, the correct typographic apostrophe.
Smart to straight does a plain character swap — every curly double-quote variant (” “ „ ‟) becomes ”, and every curly single-quote variant (’ ‘ ‚ ‛) becomes ’.
Worked example
Input: ”Hello,” she said. ‘It’s fine,’ he replied.
Straight-to-smart output: ”Hello,” she said. ‘It’s fine,’ he replied.
Why each quote converted the way it did:
- The
”at the very start of the string → opening”(nothing before it) - The
”after the comma and space → closing”(follows a letterothen comma) - The
’beforeIt→ opening’(follows a space) - The
’inIt’s→ closing’(follows a lettert) - The
’afterfine→ closing’(follows a letter)
| Straight | Opening form | Closing form |
|---|---|---|
” | ” | ” |
’ | ’ | ’ |
When curly quotes break things
Curly quotes look identical to straight quotes in most reading environments, which is why they cause confusing errors when copy-pasted into technical contexts:
- JSON:
{“key”: “value”}with curly quotes fails to parse. Most JSON parsers treat curly quotation marks as invalid characters, producing a crypticUnexpected tokenerror. - Shell commands: A quoted argument like
--flag “value”with typographic quotes causes the shell to reject the command or treat the quote as part of the literal argument. - CSV and spreadsheets: Some parsers handle curly quotes as text content rather than delimiters, wrapping the wrong cells together.
- Markdown code fences: Inline code with curly apostrophes like
it’smay render incorrectly depending on the Markdown processor.
The smart-to-straight direction is the most common real-world use case: text pasted from a word processor, Google Docs, or a blog CMS into a code editor or config file, where it silently contains typographic apostrophes that the interpreter rejects.
Notes on apostrophes in contractions
The ’ in don’t, it’s, they’re, and similar contractions is typographically a closing single quote, not an opening one — it stands in for the omitted letter or letters. Most straight-to-smart converters get this right when the apostrophe is between two letters, but edge cases like an apostrophe at the start of a word (for example ’twas) need manual review.
Everything runs in your browser — nothing is uploaded.