Comment utiliser : Smart Quotes to Straight Quotes
- Paste the code or text that fails — JSON, JavaScript, CSS, a terminal command.
- Keep “Smart → straight” selected. The report shows how many curly quotes, dashes and hidden characters were replaced.
- Copy the cleaned version. If it’s JSON, a badge confirms it now parses.
- 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
| Character | Name | Becomes |
|---|---|---|
| “ ” „ « » | Curly / angled double quotes | " |
| ‘ ’ ‚ ′ | Curly single quotes, apostrophe, prime | ' |
| – — − | En dash, em dash, minus sign | - |
| … | Ellipsis | ... |
| NBSP, thin space | Non-breaking spaces | Normal space |
| ZWSP, ZWJ, BOM, soft hyphen | Invisible characters | Removed |
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.
Aussi recherché comme : curly quotes, smart quotes, straight quotes, fix json quotes, typographic quotes, non-breaking space, em dash.
Outils complémentaires : Smart Quotes to Straight Quotes
- Soft Hyphen Generator — Stop long words like “Versicherungsleistungen” from overflowing on mobile: insert invisible soft hyphens automatically or at your own break points, then copy the result.
- 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.
- Vérificateur de différences — Collez une version originale et une version modifiée pour comparer côte à côte les lignes ajoutées, supprimées et modifiées — les mots exacts qui ont été modifiés étant mis en évidence dans chaque ligne.
- Remove Duplicate Lines — Paste a list to remove duplicate lines instantly.
Questions fréquentes
How do I fix “Unexpected token” errors in JSON?
Will it change quotes inside strings?
Why does my command fail when copied from Slack?
-- into an em dash and quotes into curly quotes. This tool turns them back into the ASCII characters your terminal expects.