What Is Harper?
Harper is an offline English grammar checker open-sourced by Automattic (the company behind WordPress), written in Rust. It already has 12,000+ Stars on GitHub and keeps trending.
It was born out of the author's frustration with existing grammar checking tools:
- Grammarly: Expensive, serious privacy concerns (everything you write gets sent to their servers), and suggestions often lack context
- LanguageTool: Great to use, but needs several GB of RAM and ~16GB of n-gram datasets, and is relatively slow
Harper's positioning is "just right" — fast, lightweight, and privacy-first.
Why Do Developers Need Harper?
| Feature | Grammarly | LanguageTool | Harper |
|---|---|---|---|
| Runtime | Cloud | Local/Cloud | Purely local |
| Privacy | ❌ Data sent to servers | ⚠️ Optional offline | ✅ Fully offline |
| Memory footprint | — | ~GB level | ~tens of MB |
| Speed | Affected by network latency | Medium | Millisecond-level |
| Open source | ❌ | ⚠️ Partial | ✅ MIT |
| Editor integration | Browser extension | Plugins | LSP + multi-plugin |
For developers, Harper's biggest appeal comes down to:
- Privacy-safe: Code, API docs, and technical blog drafts never leave your machine
- Millisecond-level response: Rule-based engine, no network requests needed
- Native LSP support:
harper-lsintegrates into virtually any LSP-compatible editor - Rust performance: Memory footprint is just 1/50th of LanguageTool's
Installing Harper
Harper offers multiple ways to use it, covering everything from browsers to IDEs.
Method One: Use Directly in the Browser
The simplest way to try it out — visit writewithharper.com. The page runs locally in your browser via WebAssembly, no registration, no internet connection required. Just paste your text and check.
Method Two: Install harper-ls (Language Server)
harper-ls is Harper's core engine, providing grammar checking for various editors through the LSP protocol.
Install via cargo (recommended)
cargo install harper-ls
Verify after installation:
harper-ls --version
Install via binary download
Harper provides pre-compiled binaries. Download the executable for your platform from GitHub Releases:
# Linux example
wget https://github.com/Automattic/harper/releases/latest/download/harper-ls-x86_64-unknown-linux-gnu.tar.gz
tar -xzf harper-ls-x86_64-unknown-linux-gnu.tar.gz
sudo mv harper-ls /usr/local/bin/
Editor Integration in Practice
VS Code
- Search for
Harperin the VS Code Extensions marketplace - Install the
harper-lsextension - Open any Markdown or plain text file — grammar checking activates automatically
// Optional settings.json configuration
{
"harper-ls.dialect": "American",
"harper-ls.markdown.ignore": ["code", "inlineCode"]
}
Obsidian
Harper has dedicated plugin support for Obsidian:
- Search for
Harperin Obsidian's Community Plugins - Enable the plugin
- While editing notes, grammar errors are highlighted with red wavy underlines
For Chinese developers writing English technical docs (like READMEs and API documentation), this is a very practical combination.
Neovim
Configure via lspconfig:
-- Configure after installing with Mason
require('lspconfig').harper_ls.setup({
settings = {
["harper-ls"] = {
dialect = "American",
userDictPath = "" -- Optional: custom dictionary path
}
}
})
Helix
Harper has native support for the Helix editor. Add this to ~/.config/helix/languages.toml:
[[language]]
name = "markdown"
language-servers = ["harper-ls"]
Emacs / Zed
LSP support works the same way — see the official docs.
Advanced Usage
Custom Dialect
Harper supports multiple English dialects:
{
"dialect": "British" // American | British | Canadian | Australian | Indian
}
Ignoring Specific Regions
In Markdown documents, you can mark sections to ignore with comments:
<!-- harper: ignore -->
This is code-related text that shouldn't be checked.
<!-- harper: end -->
Command-Line Checking (harper-cli)
If you want to integrate grammar checking into your CI/CD pipeline, use harper-cli:
# Install
cargo install harper-cli
# Check a single file
harper-cli check README.md
# Check all Markdown files in a directory
harper-cli check docs/
# Output in JSON format (easy CI integration)
harper-cli check --format json docs/ > report.json
Example output:
README.md:42:5 - "their" should be "there"
README.md:87:12 - Missing article before "documentation"
Using in GitHub Actions
name: Grammar Check
on: [push, pull_request]
jobs:
harper:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Harper
run: cargo install harper-cli
- name: Check docs
run: harper-cli check docs/ --format json > report.json
Harper vs LanguageTool: Performance Comparison
| Metric | Harper | LanguageTool |
|---|---|---|
| Startup time | < 1 second | Several seconds (needs to load n-gram data) |
| Memory usage | ~20-50 MB | ~1-4 GB |
| 1000-word document check | < 10 ms | 2-5 seconds |
| Installation size | ~10 MB | ~16 GB (including data) |
| Offline support | ✅ Fully offline | ⚠️ Requires extra setup |
Harper achieves a minimalist architecture through its rule engine + dictionary approach, without relying on massive statistical models. This also means its rule coverage isn't as comprehensive as Grammarly's, but it's already more than enough for technical docs, blogs, and emails.
Who Is It For?
✅ Recommended For
- English tech blog authors: Write docs without worrying about code snippets being uploaded to the cloud
- Non-native English speaking developers: Quickly catch grammar errors in English documents
- Privacy-conscious users: All processing happens entirely locally
- CI/CD pipelines: Automatically check document quality with harper-cli
⚠️ Not Enough (Yet)
- Need Chinese grammar checking (currently English only)
- Need deep semantic analysis and style suggestions (Harper is rule-based, no AI-powered style advice)
- Team collaboration scenarios (no shared dictionary feature yet)
Summary
Harper is a precisely positioned open-source grammar checker: lightweight, fast, and privacy-first. It won't replace Grammarly in the professional writing space, but for developers writing docs, blogs, and emails on a daily basis, it's more than up to the task.
Quick reference:
| Item | Value |
|---|---|
| GitHub | Automattic/harper |
| Stars | 12,000+ |
| Language | Rust |
| License | MIT |
| Supported languages | English (multiple regional dialects) |
| Editor support | VS Code / Obsidian / Neovim / Helix / Emacs / Zed |
| Website | writewithharper.com |
If you're tired of Grammarly's privacy issues and find LanguageTool too heavy, Harper is worth a try.