How to Add a Chinese Keyboard and Type in Pinyin

A Chinese keyboard does not have thousands of keys. You type the pinyin and pick the character - for example, type nihao and choose 你好. This guide sets that up on every device and shows how to use it for HanziBook's written exercises.

How pinyin typing works

A Chinese input method (IME) sits between your keyboard and the text box. You type pinyin letters; the IME shows a candidate list of characters that sound like that syllable, and you choose one with a number key, the space bar or the arrow keys.

You do not type tone marks. Type `ma`, then choose 妈 (mā), 麻 (má), 马 (mǎ) or 骂 (mà) from the list.
Words beat single characters. Typing a whole word is faster and more accurate: `nihao` offers 你好, and `xiexie` offers 谢谢.
The space bar usually takes the first candidate. Press it when the highlighted character is the one you want - or press the number next to another candidate.

You can type Chinese on a phone without installing anything: both iOS and Android ship with a Chinese pinyin keyboard you only need to switch on.

Windows 10 & 11

  1. Open Settings → Time & language → Language & region - On Windows 11 this is Settings → Time & language → Language & region. On Windows 10 it is Settings → Time & language → Language.
  2. Add Chinese (Simplified) - Click Add a language, search for Chinese (Simplified), and add it. Keep Chinese (Simplified, China) - that is the Mandarin pinyin input method.
  3. Switch with the language bar - Press Win + Space (or click the language abbreviation in the taskbar) to switch between English and Chinese. The taskbar should show 中 when Chinese is active.
  4. Pick the pinyin keyboard - If you only see a handwriting or shape keyboard, click the keyboard icon and choose Microsoft Pinyin. Type `nihao` in any text box and the candidate bar should appear.

Windows may install the Chinese language pack on first use - allow a minute and a connection. You do not need to change your Windows display language.

macOS

  1. Open System Settings → Keyboard - On older macOS versions: System Preferences → Keyboard → Input Sources.
  2. Add an input source - Click Edit… (or the + button), choose Chinese, Simplified, then Pinyin - Simplified. Add it.
  3. Switch input methods - Press Control + Space (or Caps Lock if you enabled it as the input switch), or click the input menu in the menu bar and choose Pinyin - Simplified.
  4. Type and choose - Type `nihao` in a text field. A candidate window appears; press the number for 你好 or use the arrow keys and Return.

In System Settings → Keyboard → Text Input → Edit, you can turn on Show Input menu in menu bar so you can always see which language is active.

iPhone & iPad

  1. Settings → General → Keyboard → Keyboards - Tap Keyboards, then Add New Keyboard….
  2. Choose Chinese (Simplified) - Pick Chinese, Simplified, then Pinyin - QWERTY (or 10-key if you prefer a phone-style keypad).
  3. Switch keyboards in any app - Tap the globe key 🌐 at the bottom-left of the keyboard, or hold it to pick the Chinese keyboard directly.
  4. Type pinyin, then tap a character - Type `nihao` and tap 你好 in the suggestion bar. The globe key switches back to English.

On iPhone and iPad the Chinese keyboard also supports handwriting and voice input - tap the microphone or the handwriting icon on the keyboard if typing pinyin is awkward.

Android (Gboard)

  1. Open Settings → System → Languages & input - The path varies by phone: on Samsung it is Settings → General management → Language and input. Look for On-screen keyboard or Keyboards.
  2. Open Gboard → Languages - Tap Gboard (or your keyboard app) → Languages → Add keyboard.
  3. Add Chinese (Simplified) → Pinyin - Choose Chinese (Simplified) and then Pinyin. You can keep English on the same keyboard.
  4. Switch with the globe key - Tap 🌐 or swipe the space bar to change language, then type `nihao` and tap 你好.

If your phone uses a different keyboard (Samsung Keyboard, SwiftKey), the steps are similar: Language and input → Add keyboard → Chinese → Pinyin.

Typing Chinese: tones, candidates and punctuation

  1. Try it: 你好 - Type `nihao`. The first candidate should be 你好 (nǐ hǎo, hello). Press space or 1.
  2. Try it: 谢谢 - Type `xiexie` and choose 谢谢 (xièxie, thank you).
  3. Try it: 我想喝咖啡 - Type `wo xiang he kafei`, choosing candidates as you go: 我, 想, 喝, 咖啡. Deleting a wrong candidate with Backspace before choosing usually fixes it.

Tones are optional when typing. Type `ma` for all four tones; the IME ranks common characters first. Tone marks are only for dictionaries and textbooks.
Type words, not just syllables. `woxianghe kafei` is easier to get right than four separate characters; the IME understands common phrases.
Use an apostrophe to separate syllables. In `Xi'an` the apostrophe keeps the two syllables apart; without it the IME may read it as one sound.
Numbers and English still work. With a Chinese keyboard active, letters type pinyin, but digits usually select candidates. Switch back with Win + Space, Control + Space or 🌐 for long English text.
Punctuation changes shape. A Chinese keyboard produces full-width marks: 。,!? and “ ” instead of . , ! ? and " ". That is correct for Chinese sentences.

If the candidate bar shows traditional characters (你好 is the same, but 谢谢 becomes 謝謝), switch the input method to Simplified in its settings. HanziBook uses Simplified characters.

Troubleshooting

No candidate bar appears - the keyboard is probably still in English mode. Check the taskbar/menu bar/globe icon; press Win + Space, Control + Space or 🌐.
Letters type Chinese but numbers do not work - the IME is capturing digits to choose candidates. Press Esc or Enter to finish the word, then type the number, or switch back to English.
Wrong character keeps winning - type the full word or phrase instead of one syllable, or press the arrow keys to reach the right candidate before pressing space.
Traditional instead of Simplified - change the input method's script setting to Simplified. On Windows: Settings → Time & language → Language & region → Chinese → Language options → Microsoft Pinyin → General → Character set.
The keyboard disappeared after an update - re-add Chinese in your language settings; operating-system updates occasionally remove unused input methods.

Using it in HanziBook

HanziBook's class exercises ask you to type Chinese in a few places. A Chinese keyboard makes them much easier:

Fill in the blank - read the sentence, then type the missing character or word into the box and press Check. The answer is compared with what your tutor set; nothing is revealed until you try.
Word order - tap the mixed words into the right order. No keyboard is needed for this one.
Translation - type the Chinese sentence, then check it. Spaces and punctuation are ignored when comparing, so do not worry about a missing 。
Your own words - if you add a word manually on HanziBook, use the Chinese keyboard for the character field and the normal keyboard for pinyin and English (or use the dictionary search instead).

On a phone, the Chinese keyboard's handwriting or voice button is a useful fallback: draw the character or say it aloud instead of typing pinyin. HanziBook's stroke-order writer on the same page shows you how to write it.

If a character still will not appear, copy it from a dictionary entry (for example from HanziBook's search results) and paste it into the answer box. That is not cheating - it is a normal way to type a rare character.