Pinyin Tone Converter (nǐhǎo ↔ ni3hao3)

Switch pinyin between tone marks and tone numbers — the form you type against the form you read.

—

What this tool does

Pinyin needs a fourth piece of information that the Latin alphabet was never built to carry: tone. The official answer is a diacritic on the main vowel — nǐ hǎo — and the practical answer, for anything that has to survive a keyboard or a database, is a trailing digit: ni3 hao3. Data copied between a dictionary, a flashcard app and a spreadsheet regularly arrives in the wrong one.

This tool converts both ways. In the marks direction it uses the standard vowel-selection rule and puts the digit at the end of the syllable; in the numbers direction it finds the right vowel and applies the correct mark.

Method

ToneMarkNumberExample
First (high)ā ē ī ō ū ǖ1mā → ma1
Second (rising)á é í ó ú ǘ2má → ma2
Third (dipping)ǎ ě ǐ ǒ ǔ ǚ3mǎ → ma3
Fourth (falling)à è ì ò ù ǜ4mà → ma4
Neutral(none)5 or 0ma → ma

Placement follows the standard rule: a before e, then the o of “ou”, otherwise the last vowel — so hǎo marks the a, but jiǔ marks the u. The umlaut vowel ü is accepted as v on input (lv4) and returned as ü (lǜ).

Example

MarksNumbers
nǐhǎoni3hao3
zhōngguózhong1guo2
shàngshang4
lǜlü4 (or lv4)

The tone-placement rule

A pinyin syllable has one tone mark, and where it sits is not arbitrary. The rule is a priority order over the vowels: mark a if present, otherwise o, otherwise e; if none of those appears, mark the second vowel of an iu or ui pair, and otherwise the single vowel. The mnemonic taught in Chinese classes is “a, o, e take it; i and u give it to the one behind”.

SyllableMarkedWhy
haohǎoa wins over o
zhouzhōuo wins over u
meiměie wins over i
liuliúno a/o/e — mark the second of iu
duiduìno a/o/e — mark the second of ui
lülǜa single vowel takes the mark; ü is written with an umlaut

Getting this wrong is the most common error in hand-written pinyin, and it is the reason a mark-to-number converter has to know the rule rather than simply attaching the tone to the first vowel. The engine here applies the priority order above, so liu2 becomes liú rather than líu.

Why several tone marks cannot simply be removed

Tone is lexical in Mandarin: the same syllable with a different tone is a different word. mā (mother), má (hemp), mǎ (horse) and mà (to scold) are four distinct words spelled identically without tones. Stripping the marks to get plain ASCII therefore loses meaning, which is why the number form exists: ma1 is unambiguous in a way that ma is not.

The numeric form is also what you can type on a plain keyboard, what survives a system that mangles combining diacritics, and what most pinyin input libraries accept. Converting marks to numbers is usually the first step before storing or searching pinyin.

ü, v and the umlaut problem

The vowel ü is written with an umlaut, but most keyboards have no ü key. The convention in the numeric form is either ü or v — lü4 and lv4 mean the same syllable. This tool accepts v on input and produces ü on output, which is the form that round-trips back to a proper tone mark.

Note that u and ü are different phonemes; substituting one for the other is not a typo but a different word. Systems that silently normalise v to u are destroying information, which is why this tool keeps the distinction.

Neutral tone and the missing digit

Not every syllable carries a tone. The neutral tone — the unstressed syllable in words like māma (mother) — has no mark, and in the numeric form it is written with no digit at all, or with 5 in some conventions. This tool uses the no-digit form: mama rather than ma1ma5. If you receive pinyin from a system that uses 5, the conversion will treat it as ordinary text rather than colouring it, so strip the fives first if you need a neutral-tone mark.

Capitalisation and spacing are preserved

The conversion works character by character within each syllable and leaves capitalisation and spacing untouched, so a name like Nǐ hǎo converts to Ni3 hao3 and back without lowercasing it. This matters for proper nouns and for sentence-initial capitals, which a careless implementation would flatten.

Where the tones actually go

The tone mark is placed over a vowel, and the choice of vowel is the rule above — not the first letter, and not the syllable's most prominent vowel by ear. This is why zhong1 becomes zhōng (over o) and not zhông (over h, which is not a vowel at all). A converter that simply puts the mark on the first vowel will produce visibly wrong output for a large fraction of real syllables.

Frequently asked questions

Why is ü written as v in tone-number form?

Because v is the key available on a plain keyboard for ü, and the numeric convention ni3 hao3 has no diacritics to carry the umlaut. The tone number supplies the tone, while v preserves the vowel quality; writing u instead would change the syllable (lu vs lü).

Why are there two ways to write a tone?

Pinyin marks the tone with a diacritic on the main vowel (nǐ hǎo), which reads well but is awkward to type. Databases, files and keyboards that cannot hold those marks use a digit instead (ni3 hao3). The two forms carry exactly the same information.

Which vowel gets the tone mark?

The rule of the standard: mark an a if there is one; otherwise mark an e; in “ou” mark the o; otherwise mark the last vowel. So hǎo marks the a, but jiǔ marks the u.

How is ü written with tone numbers?

Usually as v, because a plain keyboard has no ü: lǜ becomes lv4. This tool accepts both v and ü on input and returns ü with the mark, which is the accurate pinyin spelling.

What about the neutral tone?

It takes no mark and no number, so ma (the question particle) stays ma. A syllable given the digit 5 or 0 is treated as neutral and the digit is dropped.

Does it change the letters themselves?

No. Only the tone is rewritten — the consonants and the syllable structure are left untouched, so the conversion is reversible.

Sources

  • Hanyu Pinyin as standardised in the PRC (GB/T 16159 and the ISO 7098 romanisation), including the tone-mark placement rule.
  • The v-for-ü substitution, standard practice where a keyboard cannot produce ü.

Everything runs in your browser — nothing you type is uploaded.