How to Get Spelling Correction in VS Code on Mac
VS Code is an Electron app, which means it does not use macOS's NSSpellChecker API - and that is exactly why the system autocorrect you rely on in Mail or Notes goes completely silent in VS Code. The fix is Charm, a native macOS app that uses Accessibility APIs instead, giving you real-time spelling correction in VS Code text fields and every other app on your Mac.
Why doesn't macOS autocorrect work in VS Code?
Most native Mac apps - Mail, Notes, Pages, Messages - tap into the same system spelling engine via Apple's NSSpellChecker API. When you have autocorrect enabled in macOS System Settings, those apps inherit it automatically.
VS Code is built on Electron, a framework that embeds Chromium and Node.js into a desktop wrapper. Electron apps run in their own rendering process that bypasses NSSpellChecker entirely. The result: macOS autocorrect has no visibility into anything you type in VS Code, regardless of your system settings.
VS Code does include its own built-in spell checking for code strings - it can highlight potentially misspelled words inside string literals - but this is opt-in, code-focused, and does not correct text automatically. It does not help when you are writing a README, a commit message, or a block of docstrings.
Where developers actually need spelling correction in VS Code
If you only ever write code, this might not matter much. But most developers type a significant amount of natural language inside VS Code - and typos in that text matter.
The common cases where spelling errors slip through in VS Code:
- README and documentation files - the ones external users, teammates, and hiring managers read
- Inline comments and docstrings - visible to everyone who reviews your code
- Commit messages - permanently attached to your project history
- Markdown files - blog posts, wikis, and technical writing authored directly in VS Code
Studies of developer productivity show that the average software engineer spends roughly 30% of their working time writing natural language text - documentation, emails, messages - rather than code. Getting spelling right in that text is not a small concern.
Solution 1: Charm (recommended for real-time correction)
Charm solves the Electron problem by taking a different technical approach. Rather than relying on NSSpellChecker, Charm uses macOS Accessibility APIs to monitor and correct text across every app - including Electron apps like VS Code. From Charm's perspective, VS Code is just another text field to watch.
Once installed, Charm corrects spelling in VS Code in real time, silently, as you type. No squiggles, no popups - just quiet correction. It also runs the same way in every other Mac app you use, so one install covers your entire workflow.
How to set up Charm for VS Code
- Go to theodorehq.com/charm and purchase Charm for $9.99
- Download and install the app, then open it from Applications
- When prompted, click Open System Settings and enable Charm under Privacy & Security > Accessibility
- Charm now runs in your menu bar and corrects spelling in VS Code and every other app automatically
For a complete walkthrough of the installation process, see How to Set Up Charm on Your Mac.
Optional: disable grammar correction for VS Code
Charm has two main correction features: Spells (spelling) and Polish (grammar). For most writing, both are useful. For code files, Polish can get in the way - code does not follow sentence grammar rules, and Polish may attempt to rewrite lines it should leave alone.
The practical solution is to keep Spells active everywhere while disabling Polish specifically for VS Code. Charm supports per-app settings for exactly this purpose.
- Switch to VS Code so it is the active app
- Click the Charm icon in the menu bar
- Toggle Polish off for VS Code - Spells stays active
With this configuration, your comments, README files, and commit messages get spell-checked in real time, but Charm does not try to apply grammar rules to your source code. Spells alone is a meaningful improvement over having no correction at all.
Solution 2: Code Spell Checker extension
The VS Code Marketplace includes "Code Spell Checker" by Street Side Software, which is the most popular spell checking extension for VS Code with over 10 million installs. It is built specifically for code: it understands camelCase, understands that variable names like getUserById should not be flagged, and checks spelling inside string literals, comments, and identifiers.
Code Spell Checker highlights suspected misspellings with blue squiggles and surfaces them in the Problems panel. It does not autocorrect - it only flags. You review the suggestion and accept or reject it manually.
To install it:
- Open VS Code and press Cmd+Shift+X to open the Extensions panel
- Search for "Code Spell Checker"
- Click Install on the result by Street Side Software
The extension activates immediately and starts checking your open files. You can configure language support, add custom words to a project dictionary, and adjust sensitivity from the extension settings.
Which approach is right for you?
| Feature | Charm | Code Spell Checker |
|---|---|---|
| Works in VS Code | Yes | Yes |
| Works outside VS Code | Yes - every Mac app | No |
| Real-time autocorrect | Yes | No - highlights only |
| Code-aware (camelCase etc.) | No | Yes |
| Per-app feature control | Yes | N/A |
| On-device processing | Yes | Yes |
| Price | $9.99 one-time | Free |
Use Charm if you want real-time autocorrect for the natural language you write inside VS Code - comments, docs, commit messages - plus every other Mac app you use. One tool, everywhere, always on.
Use Code Spell Checker if you want code-aware spell highlighting that understands variable names, string literals, and camelCase identifiers. It will not autocorrect, but it will surface errors you might otherwise miss in your actual code.
Many developers run both. Charm handles silent real-time correction for all natural language text. Code Spell Checker handles code-specific spell analysis. They do not conflict, and together they cover the full surface area of what you write in VS Code.
Frequently asked questions
Why doesn't macOS autocorrect work in VS Code?
VS Code is built on Electron, which does not use macOS's NSSpellChecker API. Because Electron apps run in their own rendering process, the system autocorrect engine has no visibility into what you type in VS Code, regardless of your System Settings configuration.
Does Charm work in VS Code?
Yes. Charm uses macOS Accessibility APIs rather than NSSpellChecker, so it works in Electron apps including VS Code. Install Charm, grant Accessibility permission, and spelling correction begins working in VS Code text fields immediately - no additional configuration needed.
Should I disable Charm's grammar correction in VS Code?
Many developers choose to. Polish (Charm's grammar feature) can produce unwanted corrections in code files because code does not follow sentence grammar rules. You can disable Polish specifically for VS Code from Charm's menu bar while keeping Spells active for comments, docs, and commit messages.
What is the difference between Charm and the Code Spell Checker extension?
Charm provides real-time autocorrect across all VS Code text and every other Mac app. Code Spell Checker is a VS Code extension that highlights spelling errors in code strings, variable names, and comments - but it does not autocorrect. Many developers use both: Charm for silent correction, Code Spell Checker for code-specific analysis.
Can I use Charm just for spelling and skip grammar in VS Code?
Yes. Charm's per-app settings let you disable Polish (grammar) for VS Code while keeping Spells (spelling) active. Your commit messages, README files, and code comments get spell-checked in real time, without grammar rules being applied to code syntax.
Spelling correction in VS Code and every other Mac app.
Spelling, grammar, and word prediction across every Mac app. $9.99, yours forever.