I Built a Free AI Grammar Checker That Runs Entirely in the Browser
A few months ago I got tired of copy-pasting my writing between five different tools — Grammarly for grammar, Hemingway for readability, some word counter for stats. So I built AI Grammar Checker — a single tool that does all of that in one shot, for free, with no signup.
What it does
You paste English text, hit check, and get back:
- Sentence-by-sentence grammar corrections with explanations
- Style polish — passive voice, weak adverbs, wordy phrases flagged
- Flesch readability score so you know if your text is actually readable
- Hemingway-style highlights — hard sentences, very hard sentences, adverb count
- CEFR level (A1–C2) so non-native speakers know where they stand
- Tone detection — formal, casual, neutral
All client-side except the AI check call. No server stores your text.
The stack is stupidly simple
HTML + vanilla JS + CSS
↓
DeepSeek API (OpenAI-compatible, $0.27/million tokens)
↓
Result rendered directly in the DOM
No React. No Next.js. No build step. Just app.js, style.css, and index.html. The "backend" is a tiny Cloudflare Worker that proxies the DeepSeek API call so the API key stays server-side.
Here's roughly how the grammar check works:
async function runGrammarCheck(text, intensity) {
const systemPrompt = `You are a professional English editor.
Analyze the text sentence by sentence.
For each issue, return: original text, corrected text, explanation.
Also return: readability score, CEFR level, tone.`;
const response = await fetch('/api/deepseek', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'deepseek-chat',
messages: [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: text }
],
temperature: 0.3
})
});
return response.json();
}
The intensity slider is the interesting bit — it adjusts the system prompt to be more or less aggressive about suggesting changes. At low intensity it only flags actual errors. At high intensity it rewrites for style too.
Why DeepSeek over OpenAI
Three reasons:
Cost. DeepSeek is roughly 1/10th the price of GPT-4o for comparable quality on grammar tasks. At the free tier usage levels, my API bill is literally under $2/month.
Quality on structured output. I tested both on the same 50-sample test set (emails, essays, blog posts). DeepSeek caught 91% of errors vs GPT-4o's 93%. The 2% gap isn't worth 10x the cost.
No content moderation false positives. This is the one nobody talks about. OpenAI's moderation API sometimes flags academic writing about medical or legal topics. DeepSeek just checks the grammar.
What I'd do differently
Offline mode. The Hemingway stats (passive voice, reading time, word count) are computed locally. The grammar check needs the API. I'd like to bundle a small on-device model via WebLLM eventually.
Better mobile UX. The tool works on mobile but the text area + results layout isn't great on narrow screens. Bootstrap or Tailwind would've helped but I wanted zero dependencies.
API key flow. Right now users bring their own DeepSeek key. New DeepSeek users get 5M free tokens, which covers a LOT of grammar checks. But the UX of pasting an API key is friction. Considering a free tier with a shared key + rate limiting.
Try it
Completely free, no signup, no email. If you write in English regularly — especially if you're a non-native speaker — I'd love feedback on what's missing.
Also have a comparison page if you're curious how it stacks up against Grammarly, ProWritingAid, and others: Best AI Grammar Checkers 2026.
Top comments (0)