PHPackages                             moodsdesign/wanakana - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. moodsdesign/wanakana

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

moodsdesign/wanakana
====================

JS library for Japanese input and kana/romaji conversion

1.3.10(9y ago)070MITHTML

Since Mar 1Pushed 8y ago1 watchersCompare

[ Source](https://github.com/fmestrone/WanaKana)[ Packagist](https://packagist.org/packages/moodsdesign/wanakana)[ RSS](/packages/moodsdesign-wanakana/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (12)Versions (2)Used By (0)

 [ ![NPM package](https://camo.githubusercontent.com/3190f93d518c1c0a7aabf62e1faa318634e97e190ae26bacc2ff3ac17deae4af/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f77616e616b616e612e737667) ](https://www.npmjs.com/package/wanakana) [ ![Build Status](https://camo.githubusercontent.com/2c4b55ecc885a47e566d4d24cb6293569eee9e734288f71b94fc13b9445c95dd/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f57616e694b616e692f57616e614b616e612e737667) ](https://travis-ci.org/WaniKani/WanaKana) [ ![Test Coverage](https://camo.githubusercontent.com/9aa7f7d8cba5c2273eb9312f97a6146fa9eac8033d364471da8606efeddb81c0/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f57616e694b616e692f57616e614b616e612e737667) ](https://coveralls.io/github/WaniKani/WanaKana)

ワナカナ &lt;--&gt; WanaKana &lt;--&gt; わなかな
========================================

[](#ワナカナ----wanakana----わなかな)

#### Javascript utility library for checking and converting between Kanji, Hiragana, Katakana, and Romaji

[](#javascript-utility-library-for-checking-and-converting-between-kanji-hiragana-katakana-and-romaji)

Demo
----

[](#demo)

Visit the [website](http://www.wanakana.com) to see WanaKana in action.

Documentation
-------------

[](#documentation)

[Extended API reference](http://www.wanakana.com/docs/global.html)

Quick Start
-----------

[](#quick-start)

#### Install

[](#install)

```
yarn add wanakana
# alternatively: npm install wanakana
```

#### Or to get the minified browser (umd) bundle

[](#or-to-get-the-minified-browser-umd-bundle)

#### HTML:

[](#html)

```

  const textInput = document.querySelector('#wanakana-input');
  wanakana.bind(textInput); // uses IMEMode toKana() as default

```

#### JavaScript:

[](#javascript)

```
/* UMD/CommonJS */
const wanakana = require('wanakana');

/* ES modules */
import wanakana from 'wanakana';
// with destructuring
import { toKana, isRomaji } from 'wanakana';
// or directly reference single methods for smaller builds:
import isKanji from 'wanakana/isKanji';

/*** DEFAULT OPTIONS ***/
{
  // Use obsolete kana characters, such as ゐ and ゑ.
  useObsoleteKana: false,
  // Pass through romaji when using toKatakana() or toHiragana()
  passRomaji: false,
  // Convert katakana to uppercase when using toRomaji()
  upcaseKatakana: false,
  // Convert characters from a text input while being typed.
  IMEMode: false, // alternatives are: true, 'toHiragana', or 'toKatakana'
}

/*** DOM HELPERS ***/
// Automatically converts text using an eventListener on input
// bind() uses option: { IMEMode: true } with `toKana()` by default
// Alternatives are: 'toHiragana' or 'toKatakana' to enforce kana type
wanakana.bind(domElement [, options]);

// Removes event listener
wanakana.unbind(domElement);

/*** TEXT CHECKING UTILITIES ***/
wanakana.isJapanese('泣き虫。！〜２￥')
// => true

wanakana.isKana('あーア')
// => true

wanakana.isHiragana('げーむ')
// => true

wanakana.isKatakana('ゲーム')
// => true

wanakana.isKanji('切腹')
// => true

wanakana.isMixed('お腹A')
// => true

wanakana.isRomaji('Tōkyō and Ōsaka')
// => true

/*
 * toKana notes:
 * Lowercase -> Hiragana.
 * Uppercase -> Katakana.
 * Non-romaji and _English_ punctuation is passed through: 123 @#$%
 * Limited Japanese equivalent punctuation is converted:
 * !?.:/,~-‘’“”[](){}
 * ！？。：・、〜ー「」『』［］（）｛｝
 */
wanakana.toKana('ONAJI buttsuuji')
// => 'オナジ ぶっつうじ'
wanakana.toKana('座禅‘zazen’スタイル')
// => '座禅「ざぜん」スタイル'
wanakana.toKana('batsuge-mu')
// => 'ばつげーむ'

wanakana.toHiragana('toukyou, オオサカ')
// => 'とうきょう、　おおさか'
wanakana.toHiragana('only カナ', { passRomaji: true })
// => 'only かな'
wanakana.toHiragana('wi', { useObsoleteKana: true })
// => 'ゐ'

wanakana.toKatakana('toukyou, おおさか')
// => 'トウキョウ、　オオサカ'
wanakana.toKatakana('only かな', { passRomaji: true })
// => 'only カナ'
wanakana.toKatakana('wi', { useObsoleteKana: true })
// => 'ヰ'

wanakana.toRomaji('ひらがな　カタカナ')
// => 'hiragana katakana'
wanakana.toRomaji('ひらがな　カタカナ', { upcaseKatakana: true })
// => 'hiragana KATAKANA'

/*** EXTRA UTILITIES ***/
wanakana.stripOkurigana('お祝い')
// => 'お祝'
wanakana.stripOkurigana('踏み込む')
// => '踏み込'
wanakana.stripOkurigana('踏み込む', { all: true })
// => '踏込'

wanakana.tokenize('ふふフフ')
// => ['ふふ', 'フフ']
wanakana.tokenize('感じ')
// => ['感', 'じ']
wanakana.tokenize('I said "私は悲しい"')
// => ['I said "','私', 'は', '悲', 'しい', '"']
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md)

Contributors
------------

[](#contributors)

- [Mims H. Wright](https://github.com/mimshwright) – Author
- [Duncan Bay](https://github.com/DJTB) – Author
- [James McNamee](https://github.com/dotfold) – Contributor

Credits
-------

[](#credits)

Project sponsored by [Tofugu](http://www.tofugu.com) &amp; [WaniKani](http://www.wanikani.com)

Ports
-----

[](#ports)

The following are ports created by the community:

- Java ([MasterKale/WanaKanaJava](https://github.com/MasterKale/WanaKanaJava))

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~102 days

Total

2

Last Release

3620d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5523c3946da44a0b41ab1bd7b5e4e6bceb652a24219a8e07c8ae84355ca870c?d=identicon)[moodsdesign](/maintainers/moodsdesign)

---

Top Contributors

[![DJTB](https://avatars.githubusercontent.com/u/5353151?v=4)](https://github.com/DJTB "DJTB (102 commits)")[![mims-huge](https://avatars.githubusercontent.com/u/10224824?v=4)](https://github.com/mims-huge "mims-huge (100 commits)")[![Geggles](https://avatars.githubusercontent.com/u/16900837?v=4)](https://github.com/Geggles "Geggles (22 commits)")[![vietqhoang](https://avatars.githubusercontent.com/u/1300077?v=4)](https://github.com/vietqhoang "vietqhoang (21 commits)")[![mimshwright](https://avatars.githubusercontent.com/u/141928?v=4)](https://github.com/mimshwright "mimshwright (12 commits)")[![dotfold](https://avatars.githubusercontent.com/u/502910?v=4)](https://github.com/dotfold "dotfold (11 commits)")[![vladh](https://avatars.githubusercontent.com/u/291640?v=4)](https://github.com/vladh "vladh (1 commits)")[![johnnyshields](https://avatars.githubusercontent.com/u/27655?v=4)](https://github.com/johnnyshields "johnnyshields (1 commits)")[![matank](https://avatars.githubusercontent.com/u/6172278?v=4)](https://github.com/matank "matank (1 commits)")[![ale110](https://avatars.githubusercontent.com/u/7107101?v=4)](https://github.com/ale110 "ale110 (1 commits)")

---

Tags

japaneseromajihiraganakatakanaimekana

### Embed Badge

![Health badge](/badges/moodsdesign-wanakana/health.svg)

```
[![Health](https://phpackages.com/badges/moodsdesign-wanakana/health.svg)](https://phpackages.com/packages/moodsdesign-wanakana)
```

###  Alternatives

[nihongodera/limelight

A php Japanese language text analyzer and parser.

10678.9k](/packages/nihongodera-limelight)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
