Fix Smart Quotes — Convert Curly Quotes to Straight Quotes

Code copied from Slack, Notion, Word or a blog won’t run? Typographic “smart quotes”, dashes and non-breaking spaces are usually the culprit — clean them in one paste.

Runs in your browser
Cleaned

Your data never leaves your computer. All processing happens 100% locally in your browser.

How to use the Smart Quotes to Straight Quotes

  1. Paste the code or text that fails — JSON, JavaScript, CSS, a terminal command.
  2. Keep “Smart → straight” selected. The report shows how many curly quotes, dashes and hidden characters were replaced.
  3. Copy the cleaned version. If it’s JSON, a badge confirms it now parses.
  4. Writing copy instead? Switch to “straight → smart” to get proper typographic quotes and dashes.

Why smart quotes break code

Word processors, Slack, Notion, Google Docs, macOS and many CMSs “helpfully” replace straight quotes (" and ') with curly typographic quotes (“ ” and ‘ ’). Programming languages only understand straight quotes, so code pasted from those apps fails with errors like Unexpected token “ in JSON, SyntaxError: Invalid or unexpected token or a shell command that silently does the wrong thing. Visually the difference is tiny, which makes the bug hard to spot.

What gets replaced

CharacterNameBecomes
“ ” „ « »Curly / angled double quotes"
‘ ’ ‚ ′Curly single quotes, apostrophe, prime'
– — −En dash, em dash, minus sign-
…Ellipsis...
NBSP, thin spaceNon-breaking spacesNormal space
ZWSP, ZWJ, BOM, soft hyphenInvisible charactersRemoved

The em dash in --flag is a classic: Slack turns a double hyphen into “—”, and the command-line option stops working.

Preventing it

  • Share code in code blocks (backticks in Slack, Notion, GitHub) — they keep quotes straight.
  • On macOS, turn off System Settings → Keyboard → Text Input → Use smart quotes and dashes.
  • In Word, disable “Straight quotes with smart quotes” under AutoCorrect → AutoFormat As You Type.

Once the quotes are fixed, format and validate JSON with the JSON Formatter.

Tools that pair well with the Smart Quotes to Straight Quotes

  • HTML Entity Encoder — Escape < > & " so text is safe to show in HTML, convert accents and symbols to named or numeric entities, or decode entity-filled HTML back to plain text.
  • Diff Checker — Paste an original and a changed version to see added, removed and modified lines side by side — with the exact words that changed highlighted inside each line.
  • Remove Duplicate Lines — Paste a list to remove duplicate lines instantly.
  • Markdown Task List Converter — Paste a plain list, bullet points or half-finished checklist and get clean - [ ] task lists for GitHub, GitLab or Notion — plus HTML, Jira and CSV versions.

Frequently asked questions

How do I fix “Unexpected token” errors in JSON?
Usually the JSON contains curly quotes from a document or chat app. Paste it here, copy the cleaned version, and validate it in the JSON Formatter.
Will it change quotes inside strings?
Yes — every curly quote becomes straight. If your strings intentionally contain typographic quotes, review those spots after cleaning.
Why does my command fail when copied from Slack?
Slack converts -- into an em dash and quotes into curly quotes. This tool turns them back into the ASCII characters your terminal expects.
Can it add smart quotes instead?
Yes. Switch to “straight → smart” to convert plain quotes into typographic quotes and hyphens between words into en or em dashes for published copy.

Related tools