Skip to content
Golang library for conversion between Japanese hiragana, katakana and romaji
Branch: master
Clone or download
Latest commit 3514925 May 9, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore update travis.yml and gitignore May 2, 2014
.travis.yml Update .travis.yml May 9, 2019
LICENSE add LICENSE file Aug 15, 2016 Update Aug 14, 2016
hiragana.go add che Apr 5, 2015
init.go Auto-initialize and remove need for newKana function Oct 11, 2013
kana.go add "c" to consonants list (fixes #24) Oct 8, 2016
kana_test.go add "c" to consonants list (fixes #24) Oct 8, 2016
katakana.go add che Apr 5, 2015
trie.go remove unused code Jul 21, 2017

Build Status go report card


A golang library to convert hiragana to romaji, katakana to romaji, romaji to hiragana and romaji to katakana.


Simply install with go get:

go get


To use kana, you'll have to import it:

import ""
k := kana.NewKana()

kana can do many things. It can convert hiragana or katakana to romaji:

s := kana.KanaToRomaji("バナナ") // -> banana
s = kana.KanaToRomaji("かんじ") // -> kanji

It can convert romaji to hiragana or katakana:

s := kana.RomajiToHiragana("kanji") // -> かんじ
s = kana.RomajiToKatakana("banana") // -> バナナ

It can tell you whether strings are written with kana, kanji or latin characters:

kana.IsLatin("banana") // -> true
kana.IsLatin("バナナ") // -> false

kana.IsKana("banana") // -> false
kana.IsKana("バナナ") // -> true

kana.IsKanji("banana") // -> false
kana.IsKanji("減少") // -> true

It can also normalize a given romaji string to a more standardized form (from the form given by Google Translate, for example):

kana.NormalizeRomaji("Myūjikku") // -> myu-jikku
kana.NormalizeRomaji("shitsuree") // -> shitsurei

Please feel free to use, contribute, and enjoy! You can also see this in action at


You can’t perform that action at this time.