Skip to content
v1.6.2 · MIT License

search and lookup for JavaScript

kanji.js is a small, open-source library that searches and looks up Japanese kanji characters in Node.js and in the browser.

$ npm install kanji.js

day, sun, Japan, counter for days

JLPT 4Grade 14 strokesFreq #1
On
Kun

Kanji.getDetails('日')

13,108 characters

The full KANJIDIC2 dictionary ships with the library. You get meanings, on and kun readings, stroke counts, school grades, JLPT levels and frequency ranks, with no network requests.

Fuzzy search

Rank characters by English meaning or by reading typed in romaji, and filter them by school grade or JLPT level, using exact values or ranges.

Runs anywhere

One UMD build that works in Node.js, bundlers and plain <script> tags. TypeScript types are included, and there is no setup step.

Four static methods. Nothing to configure.

Import the class and call its methods directly. The dictionary is bundled, so results come back synchronously as plain objects.

Read the API reference
import Kanji from 'kanji.js'
Kanji.getDetails('気')
// { literal: '気', meanings: ['spirit', 'mind', …], … }
Kanji.search({ meaning: 'counter for days', grade: 1 })[0]
// { literal: '日', onyomi: ['ニチ', 'ジツ'], … }
Kanji.random()
// a random entry from the dictionary