I wrote a 40-line hiragana drill to learn hiragana in five days
I wrote a 40-line hiragana drill to learn hiragana in five days
Most advice on how to learn hiragana boils down to the same plan: don't swallow all 46 characters at once, take them in batches of 10–15, attach a picture to each one, write it by hand and test yourself straight away. The method is described well in this guide on how to learn hiragana fast. As a developer I wanted the "test yourself" part to be a script I could run every morning, so here it is — plain JavaScript, no dependencies.
The data: 46 characters in rows
Hiragana is a syllabary, and the natural batches are its rows: あ-row, か-row, さ-row and so on. Two rows a day gives about ten characters — right inside the 10–15 range.
const ROWS = [ ['あいうえお', 'a i u e o'], ['かきくけこ', 'ka ki ku ke ko'], ['さしすせそ', 'sa shi su se so'], ['たちつてと', 'ta chi tsu te to'], ['なにぬねの', 'na ni nu ne no'], ['はひふへほ', 'ha hi fu he ho'], ['まみむめも', 'ma mi mu me mo'], ['やゆよ', 'ya yu yo'], ['らりるれろ', 'ra ri ru re ro'], ['わをん', 'wa wo n'], ]; const toKana = ([chars, romaji]) => { const r = romaji.split(' '); return [...chars].map((ch, i) => ({ ch, romaji: r[i] })); }; console.log(ROWS.flatMap(toKana).length); // 46 Ten rows, two per day — five days. That matches the usual estimate that you can read all of hiragana in 3–5 days.
How to learn hiragana with a drill: today + yesterday
The second rule of the method is to review yesterday's batch before moving on. So the question pool is today's two rows plus yesterday's two:
function makeDrill(day, misses = new Map()) { const today = ROWS.slice(day * 2, day * 2 + 2).flatMap(toKana); const yesterday = day > 0 ? ROWS.slice(day * 2 - 2, day * 2).flatMap(toKana) : []; const pool = [...today, ...yesterday]; return { next() { // characters you got wrong come up three times as often const weighted = pool.flatMap(k => Array(misses.get(k.ch) ? 3 : 1).fill(k)); return weighted[Math.floor(Math.random() * weighted.length)]; }, check(k, answer) { const ok = answer.trim().toLowerCase() === k.romaji; misses.set(k.ch, ok ? Math.max(0, (misses.get(k.ch) || 0) - 1) : (misses.get(k.ch) || 0) + 1); return ok; }, }; } Keep misses in a JSON file between days and the "stubborn" characters will keep coming back until you stop missing them.
Hiragana pairs that pile up in the misses map
The misses map tends to fill up with the same few characters:
- さ / ち — almost mirror images. Learn them as a pair.
- は / ほ — differ by one stroke. Look at them side by side.
- め / ぬ — both have a loop; ぬ has the extra one.
- き is the easy one thanks to the classic mnemonic: it looks like a key, and "key" sounds like ki.
What the script can't do
A drill checks recognition, but it does not replace writing. Writing each character by hand in the right stroke order is what makes the shape stick, so run the script after filling a page of practice for the day's rows. Reading real words — ねこ, さくら — from characters you already know is the other half.
If you want the full method with mnemonics, a kana quiz and an FAQ on stroke order and what to learn next (katakana), the guide linked above covers it. The script is just a small helper for people who learn hiragana better with a terminal open.