MainspringGuides › Smart Quotes for Coders
macOS Guide

Turn off smart quotes on Mac for coding

Updated July 2026 · 3 min read

You draft a shell command in Notes, paste it into Terminal, and it fails with a cryptic error — because macOS quietly turned your " into a curly and your --flag into an em-dash. That's smart quotes and smart dashes. Turn them off in System Settings → Keyboard → Text Input → Edit, or with a defaults write command, and everything you type stays literal.

Turn off smart quotes and dashes

  1. Open System Settings → Keyboard.
  2. In the Text Input section, click Edit….
  3. Turn off Use smart quotes and dashes.
  4. Click Done. New text you type in most apps now stays straight.

Prefer the command line, or scripting a fresh Mac? These two keys do the same thing — smart quotes and smart dashes are separate switches:

# keep straight quotes: "code" stays "code"
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# keep double hyphens: --flag stays --flag, not an em-dash
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false

# undo — re-enable both
defaults delete NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled
defaults delete NSGlobalDomain NSAutomaticDashSubstitutionEnabled

No logout is needed, but apps read the setting when they launch, so quit and reopen the app you're typing in for the change to register. This works the same on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia.

Where it bites — and where it never did

Real code editors — VS Code, Xcode, JetBrains, a terminal editor — don't apply smart quotes, so your source files were always safe. The damage happens in Apple's rich-text apps and then travels:

Turning the setting off globally stops the conversion at the source, so anything you copy out of those apps is already correct.

Skip the Terminal round-trip

Mainspring turns smart quotes and smart dashes into labelled one-click toggles you can flip off and back on — two of 90+ hidden macOS settings it makes reversible, so your snippets stay copy-paste safe without a defaults command.

Try Mainspring free →

Signed & notarized by Apple · 1-day free trial · $29 once

One app still curling quotes?

TextEdit and a few others keep a per-app override under Edit → Substitutions, which can re-enable smart quotes even after you've turned off the global setting. If a single app misbehaves, uncheck Smart Quotes there too. For the related autocorrect behaviour, see how to turn off autocorrect on Mac.