πͺΆ OpenGrammar
Your privacy-first, open-source writing assistant.
The free, self-hostable Grammarly alternative.
OpenGrammar is a powerful, self-hostable browser extension that helps you write clearly and confidently everywhere on the web. It's built to feel like the premium writing assistants you know, but with a critical difference: you control your data, and it can run completely for free.
π Why OpenGrammar?
Most popular grammar assistants require you to send every keystroke to their servers and charge a hefty monthly fee for advanced features. OpenGrammar changes that:
- Zero Cost Option: The core engine runs locally in your browser, checking for passive voice, repetition, and readability without needing a server or an internet connection.
- Bring Your Own AI: Want advanced, context-aware grammar corrections? Just paste in your own API key (like OpenAI, Groq, or OpenRouter). You pay only fractions of a cent for what you actually use, directly to the AI provider.
- Absolute Privacy: We don't have a database. We don't have user accounts. Your API key never leaves your browser. If you use the AI features, your text is sent securely to a stateless edge function, processed, and immediately forgotten.
- Open Source & Self-Hosted: You can deploy the backend to Cloudflare Workers or Vercel Edge for free in one command. You own the infrastructure.
β¨ Features
- Works Everywhere: Seamlessly integrates into text inputs, textareas, and rich text editors (like Gmail, Google Docs, Notion, and Reddit).
- Blazing Fast: Built with modern web technologies (React, Vite, Manifest V3) for minimal performance impact.
- Dual-Engine Architecture:
- Rule-Based (Free & Offline): Catches passive voice, repeated words, and overly long sentences.
- AI-Powered (Requires API Key): Advanced grammar, spelling, clarity, and stylistic suggestions using models like GPT-4, Groq, Together, or open-source alternatives via OpenRouter and Ollama.
- Tone & Style Rewriting: Right-click context menus or shortcuts to quickly rewrite text in 8 different tones (Formal, Casual, Professional, etc.).
- Writing Statistics: Built-in dashboard for readability scores, reading time, and vocabulary diversity.
- Intuitive UI: Familiar red, yellow, and blue underlines with click-to-apply suggestions.
π Getting Started (For Users)
Note: Since this is an open-source developer project, it is not yet published on the Chrome Web Store. You will need to load it manually.
- Download the Extension: Download the latest release or clone this repository.
- Open Extensions Page: In Chrome, go to
chrome://extensions/. - Enable Developer Mode: Toggle the switch in the top right corner.
- Load Unpacked: Click the "Load unpacked" button and select the
opengrammar/extension/distfolder you built or downloaded. - Configure: Click the OpenGrammar icon in your browser toolbar. Paste your OpenAI, Groq, or OpenRouter API key to enable advanced AI capabilities.
π» Developer Guide: Build & Deploy
Want to build OpenGrammar from scratch or deploy your own backend? Here is how.
Prerequisites
- Node.js (v18 or newer)
- npm, pnpm, or yarn
1. Set up the Backend (Serverless Edge API)
The backend is a lightweight API that securely handles the AI requests.
# Navigate to the backend folder
cd opengrammar/backend
# Install dependencies
npm install
# Run locally for testing (runs on http://localhost:8787)
npm run dev
# Deploy to Cloudflare Workers (requires a free Cloudflare account)
npx wrangler deploy
After deploying, copy the provided URL (e.g., https://opengrammar.yourname.workers.dev).
2. Set up the Chrome Extension
# Navigate to the extension folder
cd opengrammar/extension
# Install dependencies
npm install
# IMPORTANT: Link your Backend
# Open src/background/index.ts and replace the BACKEND_URL with your deployed URL from step 1.
# Build the extension
npm run build
This will create a dist/ folder. Load this folder into Chrome following the user instructions above.
π€ Contributing
OpenGrammar is a community effort! Whether you want to add new local grammar rules, improve the highlighting logic in rich text editors, or fix bugs, we welcome your contributions.
Please check out our ROADMAP.md to see what we are currently working on.
π License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.