How does Japanese Keyboard Input work?

When I started to learn Japanese, I tried to look up Japanese input - and it felt much like an in-club: not having the right search terms, not having a good understanding of the writing system either, and without someone around to ask you were lost. Let’s look into this, along with some details about the Japanese language.

The Latin alphabet which is widely used has just 26 characters, so normal keyboards simply map one letter to each key. The shift key allows to choose upper/lower case. In Japanese, one should know 2000 Kanji to read a newspaper. These are composed out of one or more glyphs, this picture shows an old keyboard which actually attempted to map multiple glyphs to single keys, and then use modifier keys to select one of these glyphs:

jap keyboard

Such a keyboard can not be used in laptops, is not user friendly, is not allowing to add new Kanji - so let’s look at what’s done in reality.

1: Background, The Japanese writing system

Today, Kana-to-Kanji conversion is most widely used for Japanese input. As hardware, normal keybards with US-American or European key layouts can be used.

The Japanese writing system is composed of 3 scripts:

  • Hiragana: consists of 50 syllables. Natively, the look like for example ま, み, む, め, も. We can try to express the sound with Latin characters: ma, mi, mu, me, mo. When someone masters the hiragana, then already all Japanese words/sentences can be expressed.
  • Katakana: consists also of 50 syllables, all of them have a counterpart in the Hiragana alphabet which sounds similar. Katakana look like this: マ, ミ, ム, メ, モ. Also these 5 syllables are spelled ma, mi, mu, me, mo. Katakana are often used to express spelling of names, or words which initially came from other languages.
  • Kanji: These are the most complex pieces, comparable to words in English or other languages. Kanji are composed from one or more glyphs.
    • 車 (spelled: kuruma) is a Kanji with a single glyph, it means ‘car’
    • 救急車 (spelled: kyukyusha) is a Kanji with 3 glyphs, meaning ‘ambulance’

If Hiragana can already express everything, why bother with the other 2 systems? We would just use a managable amount of 50 different characters and could be done. That would be a bit like using ENGLISH IN UPPERCASE ONLY. BASICALLY WORKS, BUT IS HARD TO READ. Also, Japanese has many homophones, so words which sound quite similar but have different meanings. So one word written in Hiragana can mean different things, but writing it in Kanji makes reading and understanding easier. Besides, using only Hiragana would just be lame - Japanese is full of beauty and culture, and one needs all 3 alphabets to experience that.

Typical Japanese sentences are written with Kanji, along with Hiragana, and also Katakana.

2: Fonts

First precondition: the system needs the right fonts to display the characters we want to input. Nowadays, mostly unicode is used to refer to the characters which should be displayed. The system needs a font which includes these unicode characters. If all characters in this article here are properly displayed and do not end up as a ‘white box’, that is a good sign. Also visiting the wikipedia page of the target language is a quick test to verify if fonts are missing: Wikipedia Japan.

Even if here everything looks ok, we should be prepared to hit Kanji or other characters in the future for which we have no font installed. With the Latin alphabet, we have 26 characters and can quickly verify if at least one font covers these. For Japanese, we are dealing with the core of the ~2000 most used Kanji which are more likely to be covered, and then many more.

3: Required software

Hardware wise, a normal keyboard with for example US-American layout can be used.

Let’s look at the software. We will need to deal with multiple input modes, in most cases one mode for inputting the Latin alphabet and one mode for Japanese.

We need to use 2 kinds of new software:

  • one to allow Japanese input, so to interpret our key strokes, translate them into Japanese and send that to the underlying application.
    Examples on Linux: Mozc, KKS or Anthy.
  • and one application for switching between the input modes. At least, one wants to be able to switch between English and Japanese input methods. On Linux, ibus or fcitx are typical input switchers.

On Mac OS X or windows, the software comes with the operating system. On Linux, the packages can be installed with the whole distro when selecting Japanese as language, or afterwards. On Fedora Linux, I install package fcitx5-mozc - this is the Japanese input software, and the installation also triggers the installation of the input switcher.

4: Actual Keyboard Input

When the window manager starts, I open a terminal or a graphical application like Firefox - and with my settings the Japanese input mode is active by default. A small icon indicates the currently active mode.

When pressing a key combination like +, the input switcher software toggles between the input methods. Initially, the hotkey needs to be configured, for me in starting the fcitx5-config-qt utility.

Setting up further modes for example for German and Russian is easy.

With the Japanese mode active, let’s input a sentence. As per my configuration, I can now press Latin characters, and get them converted to Hiragana: pressing the 2 keys ‘ma’ leads to ま. Just keeping typing, we get full Hiragana sentences:

きょうはあたたかいですね。

Pressing the same keys while in English input mode, we get this:

kyouhaatatakaidesune.

To get Katakana and Kanji, we can input some Hiragana, and then press ‘space’. With this, the input engine looks at a dictionary, and takes guesses what we might mean. Japanese has many homophones, so a combination of Hiragana could potentially mean various different Kanji - because of this we are presented with a graphical menu and can select the Kanji we intend to write here.

fcitx moxc

きょう is our first Kanji, we invocate completion and get 今日, a Kanji composed from 2 glyphs. The first part, 今, means ’now’, and the second part ‘day’, together they mean ’today’. Following this, we can input the full sentence:

今日は暖かいですね。- It's warm today, isn't it?

So there we have it: we basically use keys labeled with the Latin characters, to express in Hiragana the Japanese words we want to write down, and the input methods is then offering us Japanese words which sound like what we want to type, we select what we are looking for and have written a sentence.

5: More language details

If this is your first contact with Kanji, some more details. From the above you might think that like for Latin letters, as soon as we see a glyph like 今, we know the meaning and how its spelled - but that does not apply. For example, this glyph by itself is spoken ‘ima’ and means now. The Kanji 今日 contains the glyph, but is spelled ‘kyou’, so no traces of the spelling before. The meaning of 今日 is ’today’.

The Kanji 今年 again has the glyph, is spelled ‘kotoshi’, and means ’this year’. So the spelling of the very same glyph has changed again. Almost all glyphs have more than one spelling. When reading, one needs to look at the whole compound of glyphs, and then judge on the correct spelling.

One of the reasons for this is that Japanese Kanji have their roots in China: at one point in the past they were used in China for writing, and Japanese was only spoken. Kanji were then introduced in Japan, and depending on the circumstances, Chinese or Japanese readings are used for Kanji.

Reading English or German words is not that different, though. You probably have seen children reading texts in deciphering letter by letter, spelling them slowly and then concluding on the whole word. When we master reading, we also look at the whole word and spell it - just spelling the letters one by one is not counting as ‘fluent reading’.


Last modified on 2023-02-23