thumbnail

Harper — The Free, Private Grammarly Alternative Built in Rust

Better Stack · 5:40
Harper: The Free, Private Grammarly Alternative Built in Rust
🦀 Rust 📝 Grammar Checking 🔒 Privacy-First ⚡ Offline 🆓 Open Source 🧩 Editor Integration

1 Grammarly's $140 Privacy Problem

▶ 0:00

The video opens with a hard look at the cost — both financial and privacy-wise — of using Grammarly:

  • Grammarly Premium costs $140+/year — and that's the starting price
  • Per Grammarly's own documentation, everything you type is shipped to their servers and stored
  • This includes code comments, private messages, and anything you write in any text field where the extension is active
"A more blunt name for that would be a key logger you pay for." — Better Stack

Enter Harper: a free, open-source, Rust-based grammar checker that works entirely offline. No accounts, no cloud, no data leaving your machine — ever.

The pitch: Harper gives you the core grammar checking features of Grammarly without any of the privacy concerns, the subscription fees, or the cloud dependency. It's built in Rust for raw speed and runs locally on your hardware.

2 How Harper Works — Rule-Based, No AI

▶ 0:31

Harper takes a fundamentally different approach from Grammarly. There is no AI, no machine learning model, no neural network. It's a pure rule-based engine:

How the Engine Works

  1. Your text is tagged word by word — each token gets classified
  2. The tagged text is run through ~287 handwritten Rust rules
  3. Each rule checks for a specific pattern — a misspelling, a duplicate word, a confused homophone
  4. If a rule matches, it fires an underline with a suggested fix
Deterministic output: The same sentence will always produce the same verdict. No model randomness, no confidence thresholds, no changing its mind between runs.

This stands in stark contrast to Grammarly's ML-based approach:

"Grammarly tells you to delete a comma at 9 and put it back at 10 — that's what happens when an ML model changes its mind." — Better Stack

Performance & Ownership

  • Nothing leaves your machine — all processing is local
  • Claimed performance: under 10ms per check — instant feedback on every keystroke
  • Since November 2024, Harper belongs to Automattic (the company behind WordPress)
  • License remains Apache 2.0 — fully open source

3 Live Demo — Offline Grammar Checking

▶ 1:28

Installation

Getting started is a one-liner:

  • brew install harper — or install the VS Code extension
  • Native to Apple Silicon — compiles natively, no Rosetta needed

Wi-Fi Off Demo

The demo is done with Wi-Fi completely turned off to prove there's zero cloud dependency:

InputDetectionSuggestion
"I ate and pineapple"Wrong wordFlagged instantly
"I need the the from the store"Duplicate wordRemove duplicate "the"
"Your point is mute"Confused homophoneSuggests "moot" (handwritten rule in source)
"I don't think it's too late" (with typos)3 underlinesFlagged before finishing sentence
Zero latency: No spinner, no cloud round-trip, nothing to wait for. Errors appear as you type — before you even finish the sentence.

4 Code Comments & Editor Integration

▶ 2:15

This is where Harper truly differentiates itself from every other grammar checker:

Code-Aware Checking

  • Checks grammar inside comments in TypeScript, Python, and virtually every programming language
  • Ignores actual code — only prose in comments gets checked
  • This is a capability Grammarly simply doesn't have in a useful way

Editor Support via LSP

Harper ships a Language Server Protocol (LSP) server — zero-config integration with:

  • Neovim — native LSP client
  • Zed — built-in support
  • Helix — built-in support
  • Emacs — via lsp-mode or eglot
  • VS Code — dedicated extension

Obsidian Plugin

  • 200,000+ downloads
  • Checks notes and markdown prose
  • Skips code fences — Grammarly trips over these, flagging variable names and syntax as errors

WebAssembly Build

  • Harper compiles to WebAssembly
  • writewithharper.com runs the full checker in-browser — no server, no backend
"Grammarly is an app that watches you type. Harper is a component you install into your tool chain." — Better Stack

5 Harper vs Grammarly vs LanguageTool

▶ 3:07

FeatureHarperGrammarlyLanguageTool
PriceFree$140+/yrFree / Premium
Privacy (Offline)100% localCloud onlySelf-host possible
EngineRule-based (287 rules)ML / NeuralRule-based (6,000+ rules)
Speed<10msNetwork latencyVaries
Tone / Style CoachingNoYesLimited
Sentence RewritesNoYesNo
Code Comment CheckingNativeNoNo
LanguagesEnglish (5 dialects)30+30+
Open SourceApache 2.0ProprietaryLGPL (server)
LanguageTool caveat: LanguageTool's good context-aware checks need a 16GB n-gram dataset loaded into RAM to be competitive. Skip that, and Hacker News users found it missing obvious errors that even basic checkers catch.

Grammarly's ML does things Harper doesn't attempt: tone clarity coaching and whole sentence rewrites. These are fundamentally different capabilities that require statistical models.

6 Limitations — The Ceiling of Rules

▶ 3:34

The video is refreshingly honest about where Harper falls short:

Demo of Missed Errors

InputHarper's Response
"Me and Sally went to have seen the duck's cousin"Zero errors flagged
"What your name? What day today?"Also clean — no flags
"That's the ceiling of rules — if no rule matches the break, nothing fires." — Better Stack

Known Issues & Concerns

  • 287 rules vs LanguageTool's 6,000+ — significantly smaller rule set means less coverage
  • ~240 GitHub issues mention false positives (e.g., flagging "Cloudflare" as an error)
  • Fixes are shipping weekly, but the gap is real
  • No independent benchmarks exist — there's no third-party data comparing catch rates
  • One Neovim user reported the LSP process consuming 1GB+ RAM
  • English only — supports 5 English dialects, no other languages
Automattic ownership concern: Some developers won't adopt anything under Matt Mullenweg's control, given recent WordPress ecosystem controversies. The Apache 2.0 license mitigates fork risk, but governance concerns remain.

The core trade-off is clear: coverage is what you trade for privacy and speed. Harper will never catch the subtle grammatical errors that an ML model trained on billions of sentences can identify.

7 The Verdict — When to Use Harper

▶ 4:50

Keep Grammarly If…

  • You pay for and rely on tone rewrites and style coaching
  • You need multi-language support
  • You want sentence-level rewriting suggestions

Use Harper If…

  • You want free, private, instant grammar checking
  • You work in code editors and need comment/commit message/doc checking
  • You use Obsidian for notes and want grammar checking that respects markdown
  • You're a developer who values deterministic, predictable tooling
The sweet spot: For free, private, instant checking inside your editor for code comments, commit messages, docs, and notes — "nothing else comes close."
A Hacker News user — a dyslexic writer who paid for Grammarly for years — said: "It actually worked better back when it was dumb and rule-based." — HN commenter, cited in video
"When a tool fires on every keystroke in your editor, predictability isn't a compromise, it's the whole feature." — Better Stack
Final word: "The best privacy feature ever shipped isn't a settings toggle or a policy page. It's software that never needed your data in the first place."

🎯 Key Takeaways

  1. Harper is a free, open-source, Rust-based grammar checker that works 100% offline with zero cloud dependency
  2. Rule-based engine (287 rules) = deterministic, instant (<10ms), but limited compared to ML-based tools like Grammarly
  3. First-class support for code comments across all editors via LSP — the sweet spot Grammarly can't reach
  4. Owned by Automattic, Apache 2.0 licensed, with weekly releases and active development
  5. Coverage trade-off: you get privacy and speed in exchange for catching fewer complex grammatical errors
  6. Best for: developers checking comments, commits, docs, and notes inside their editor