Smart quotes look polished in prose and cause real problems in code and plain-text fields. Here is how to straighten them quickly.
Smart quotes vs straight quotes
- Smart (curly) quotes are the typographic ones: “ ” for doubles, ‘ ’ for singles. Word processors and chatbots insert them automatically.
- Straight quotes are the plain ones:
"and'. Code, config files, and many systems expect these.
The trouble starts when curly quotes end up where straight quotes belong. A curly quote in a string literal will throw a syntax error. In a CSV or config file it can break parsing. In a plain-text email field it can render oddly.
The quick fix: a cleaner
Paste your text into a tool that straightens quotes and it converts both kinds in one pass. textscrubr replaces curly double and single quotes with straight ones and, at the same time, removes the invisible characters and fixes the em dashes that usually come with the same pasted text. It leaves quotes inside code blocks alone if you are working with Markdown, so it does not change something that was meant to stay.
Find and replace
In an editor you can do it manually, but you have to handle each character:
- Replace
“and”with". - Replace
‘and’with'.
Copy each curly character from your text into the search box, since you usually cannot type them directly. Miss one and you still have a stray curly quote waiting to break something.
A caution on prose
Straight quotes are correct for code and many plain-text contexts, but for published prose, curly quotes are the typographically correct choice. So convert to straight quotes when the destination needs them (code, data, config, plain fields), and keep curly quotes when you are writing for readers. A good cleaner makes this a toggle, so you decide based on where the text is going.