Free, bilingual JLPT grammar notes from N5 to N1, published at jpnotes.dev (English) and jpnotes.dev/zh/ (中文).
Every grammar point covers how it attaches, what it means, example sentences with audio, how it differs from the patterns it gets confused with, and practice questions. The notes began as one learner's study log (N5 → N2 in 2026) and are now written for other learners.
- 93 grammar lessons, 420+ grammar points: N5 (lessons 0–17), N4 (18–34), N3 (35–58), N2 (59–75), N1 (76–92), plus A-vs-B comparison guides and a JLPT exam guide.
- Example sentences with furigana (can be toggled off), 🔊 audio for every model sentence, and translations.
- Practice: 4,000+ exam-style questions covering every JLPT item type (N5–N1), listening included, with an explanation for every option. Also timed mock tests with estimated scores, a daily challenge, and grammar flashcards with spaced repetition.
- Review: the questions you missed come back at growing intervals; a word list built from the words you tap in explanations; grammar cards; and grammar audio that reads every grammar point with examples.
- Notes: keep your own notes under any grammar point or practice question, and share the ones you like. Shared notes are reviewed before others see them, and others can reply, so a question's notes turn into its Q&A.
- Ask AI: a side panel on every lesson and after every practice question, free and with no setup (a relay on Cloudflare Workers).
- Anki decks:
.apkgand TSV per level, with audio and cloze cards. - Free, account optional. Lessons and practice pages end with a tutor card marked PR (an affiliate link). Without an account your progress stays in your browser; sign in with Google or an email code to sync it across devices and to write notes. A service worker keeps pages and audio you've opened available offline.
| Tool | Version | Needed for |
|---|---|---|
| Node.js | 20 or later | building the site (required) |
| Python | 3.10 or later | local preview server; Anki .apkg and audio generation (optional) |
| Git | any | cloning |
The commands below are for macOS and Linux. On Windows, use WSL or Git Bash.
git clone https://github.com/Ralphbupt/japanese-grammar.git
cd japanese-grammar
npm ciThe repository includes the pre-generated audio (audio/, about 3,000 mp3 files), so the first clone takes a moment.
npm run build # site + Anki TSV → dist/ (under a minute; furigana is generated here)
npm run preview # copies audio/ into dist/ and serves it at http://localhost:8000Open http://localhost:8000/. Pages use root paths (/lesson05/), so open them through the server, not by double-clicking the HTML files.
pip install genanki # Anki .apkg decks
python build-anki.py # → dist/anki/*.apkg (run after npm run build)
pip install edge-tts # audio for new or edited example sentences
python build-audio.py # → audio/s{hash}.mp3, only the missing onesLessons are markdown files in grammar/N{level}/lessonNN_topic.md. The format uses a small bilingual syntax:
## 1. 〜に過ぎない(只不过是……)||1. 〜に過ぎない (Merely…)
:::zh
1. これは私の個人的な意見**に過ぎない**。(这只不过是我个人的意见罢了。)
:::
:::en
1. これは私の個人的な意見**に過ぎない**。(This is merely my personal opinion.)
:::- Every visible string needs both languages:
中文||Englishheadings,:::zh/:::enblocks, and中文 // Englishtable cells and list items. Otherwise the English page shows Chinese. - After you add or change an example sentence, run
npm run buildand thenpython build-audio.pyto generate its audio. Audio files are named by a hash of the sentence, so editing or reordering examples never mixes them up. - To add a lesson, also add its sidebar title (
JA_TITLES) and keywords (LESSON_KEYWORDS) inbuild.js, and its page titles inseo-titles.js.
Questions are JSON files in questions/N{level}/. Authoring rules, item types and the review workflow are in questions/README.md. To check the question bank without building the site, run node build-quiz.js.
grammar/
N5/ N4/ N3/ N2/ N1/ lessons + a checklist page per level
guides/ comparison pages and the JLPT guide
questions/ practice and mock-test question bank (JSON)
pages/ About page
audio/ pre-generated TTS for example sentences
site/ client scripts: quiz, AI panel, settings, feedback, service worker
deploy/ Cloudflare config that publishes dist/ (the Worker jpnotes-site)
build.js static site generator (markdown → HTML, furigana, audio tags, SEO)
build-quiz.js validates and bundles the question bank
build-anki.js / .py Anki decks (TSV / .apkg)
build-audio.py Edge TTS for example sentences
seo-titles.js per-page titles and descriptions
Every push to main runs .github/workflows/deploy.yml. It runs npm ci and npm run build, builds the .apkg decks, and deploys dist/ to Cloudflare as the static assets of the Worker jpnotes-site (deploy/wrangler.site.toml). Audio is never generated in CI: it is generated and uploaded to the audio bucket locally, then audio/ is committed.
The AI relay (ai.jpnotes.dev), the account service (api.jpnotes.dev), the notes service (notes.jpnotes.dev), the experiments script and the content tools (audio generation, checks) are not in this repo; none is needed to build or preview the site. NOTES_SRC= and AB_SRC= build it without the notes and experiments scripts.
If you find a wrong rule, an unnatural example or a bad translation, you can:
- use the 💬 Feedback link at the bottom of any page, or "Something wrong with this question?" under a practice question (no account needed; leave an email if you'd like the reply mailed to you);
- open an issue or a pull request.
Content (notes, questions, audio, pictures, Anki decks) is licensed under CC BY-NC 4.0: credit jpnotes.dev, non-commercial use only. Code is MIT. See LICENSE.