Harper: Offline, Privacy-First Grammar Checker
GitHub Repo
Apache-2.0
October 25, 2026 at 01:32 PM
0 views

Harper: Offline, Privacy-First Grammar Checker

@AutomatticProject Author

What Harper is

Harper is an English grammar and spell checker that runs locally. Its author built it after years of frustration with existing tools: the README describes Grammarly as too expensive, overbearing and a privacy problem because every word is sent to its servers, and LanguageTool as accurate but heavy, needing gigabytes of RAM and a roughly 16 GB n-gram dataset, and taking seconds to lint a moderate document.

Harper's answer is a checker written in Rust that lints in milliseconds, uses, by the README's own claim, less than 1/50th of LanguageTool's memory, and never sends text anywhere. It is small enough to run in the browser through WebAssembly. The project lives under the Automattic GitHub organisation and is licensed under Apache-2.0.

It is aimed at developers and writers who want grammar checking inside the tools they already use: code comments and Markdown in Neovim, VS Code, Helix, Emacs or Zed; notes in Obsidian; and text fields in web apps that embed it. The docs say most users catch their mistakes in Neovim, Obsidian or Visual Studio Code.

How it works

The documentation describes Harper as, in a way, an error-tolerant parser for English: it analyses how words fit together and flags what looks wrong, pairing each error with possible corrections. An error plus its suggestions is called a lint, and Harper deliberately frames itself as a linter for English.

The architecture guide splits the project into a few crates and packages:

  • harper-core holds the tokenizer, parsing, analysis and lint rules. Its central types are a Document, a Parser trait that extracts English tokens from formats such as Markdown or source code, and a Linter trait that produces lints for a document. New rules are added as structs implementing Linter.
  • harper-ls wraps the core in a Language Server Protocol server, so any LSP-capable editor can use it over standard I/O or the network. Out of the box it parses comments in most programming languages and any Markdown file.
  • harper.js is an ECMAScript module that loads the core compiled to WebAssembly (harper-wasm), for browsers and Node.js. It powers the Obsidian plugin and the project website.

The repository also contains crates for other formats, including AsciiDoc, HTML, Typst, TeX, Python, Ink, literate Haskell, Git commit messages and Jujutsu descriptions, plus a CLI and a desktop app.

Key features

  • Fully local: linting happens on your machine or in your browser; no text is sent to a server.
  • Fast: the project's comparison table lists a suggestion time of 10 ms, against 650 ms for LanguageTool and 4,000 ms for Grammarly, and treats long lint times as bugs.
  • Language server: harper-ls brings checking to Neovim, VS Code, Helix, Emacs, Zed and Sublime Text.
  • Code-aware: it checks comments in source files rather than flagging identifiers and syntax.
  • Layered dictionaries: user, workspace (.harper-dictionary.txt), file-local and a built-in static dictionary are combined during spell checking.
  • Code actions: quick fixes, ignore-for-session, and add-to-dictionary actions at user, workspace or file scope.
  • Ignore comments: blocks containing harper:ignore or CSpell-compatible markers such as spellchecker:ignore are skipped, so Harper and CSpell can coexist.
  • Embeddable: harper.js runs in browsers, in a worker via WorkerLinter, or in Node.js via LocalLinter.
  • Integrations: Obsidian plugin, VS Code extension, Chrome and Firefox extensions and a WordPress integration are documented.

Getting started

Editor users install the language server and point their editor at it. The docs list several package managers. On macOS and Linux with Homebrew:

brew install harper

On Windows with Scoop:

scoop install harper

With a Rust toolchain, from crates.io (the docs note that only the latest stable Rust is supported and that ~/.cargo/bin must be on your PATH):

cargo install harper-ls --locked

To try it in a throwaway Nix shell:

nix-shell -p harper

Arch Linux ships it in the extra repository, Termux has a package, and portable binaries are on GitHub Releases. Each editor then has its own short setup page. For web or Node.js projects, harper.js is published on npm and can also be loaded from a CDN; in Node.js you use LocalLinter, since the worker-based linter is browser-only.

Once the language server is running, the user dictionary is created on demand the first time you add a word. By default it lives at $HOME/.config/harper-ls/dictionary.txt on Linux (or under $XDG_CONFIG_HOME), at $HOME/Library/Application Support/harper-ls/dictionary.txt on macOS and under the roaming app data folder on Windows. All dictionaries are plain, line-separated word lists, so they can be edited by hand or committed to a repository, and their locations are configurable.

Use cases

  • Documentation repositories: catch grammar and spelling mistakes in Markdown docs and READMEs while editing, with a shared workspace dictionary for project terms.
  • Code comments: lint docstrings and comments in the editor without noise from identifiers.
  • Private note-taking: grammar checking in Obsidian without sending notes to a third party.
  • Writing features in web apps: embed harper.js to give users in-browser checking with no backend. Open-source projects listed by Harper as users include Stencila and QOwnNotes.
  • Restricted environments: offline or air-gapped machines where cloud grammar services are not allowed.

How it compares

The repository's COMPARISON.md lines Harper up against three tools. LanguageTool (LGPL-2.1) has a larger ruleset including n-gram and LLM-based rules and multiple languages, with LSP support through ltex-ls. Hunspell is a classic spell checker under a LGPL/GPL/MPL tri-license without LSP support. Grammarly is proprietary and reaches editors only through a third-party language server. Harper's advantages in that table are speed, native LSP support and its Apache-2.0 licence; its listed weakness is that it supports a single language. If you need checking for languages other than English, or the broader rule coverage of an n-gram model, LanguageTool remains the heavier but broader option.

Things to know before adopting

  • English only: the core is designed to be extensible, and the project welcomes contributions for other languages, but today only English is supported.
  • Latest version only: the team actively maintains only the latest release from master; there is no long-term support line unless users ask for one.
  • Lockstep versioning: all components share one semantic version, so an integration can get a version bump even when nothing in it changed.
  • harper.js is early access: the docs state its API is not yet stable.
  • Static dictionary is built in: it cannot be edited at runtime; missing words go in your own dictionaries or through a pull request.
  • Licence: Apache-2.0 for the project, which makes it straightforward to embed in commercial products.

Project activity

As of October 2026 the Automattic/harper repository has about 17,100 stars. It was created in October 2023, is written in Rust and is licensed under Apache-2.0. The latest release is v2.13.0, published on October 16, 2026, and the repository shows commits within the past day. Source is at github.com/Automattic/harper and documentation at writewithharper.com.

Enjoying this project?

Discover more amazing open-source projects on TechLogHub. We curate the best developer tools and projects.

Project
harper-grammar-checker
Created
October 25
Last Updated
October 25, 2026 at 01:32 PM

Maintain Harper: Offline, Privacy-First Grammar Checker? Add the badge to your README

Show that the project is featured on TechLogHub and send readers to this write-up.

Featured on TechLogHub
[![Featured on TechLogHub](https://techloghub.com/badge-neutral.svg)](https://techloghub.com/open-source/harper-grammar-checker?utm_source=techloghub_badge&utm_medium=referral&utm_campaign=readme)

Find more projects like this

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.