What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To convert numbered pinyin to tone marks, apply the tone digit to the syllable’s vowel: choose a first, then e, then o; if none appears, mark the last vowel. Tone 5 is neutral and normally stays unmarked. You can implement that rule yourself or use a pinyin-notation package. This transforms pinyin you already have; it does not determine pinyin readings from Chinese characters.

How the tone-mark rule works

For a syllable with a tone number from 1 to 4, select the vowel according to this priority: a, then e, then o, then the final vowel if none of those appears. Replace that vowel with the version bearing the tone mark for the digit. Dragon Mapper documents the same placement rule, and the pinyin-tone-convert package demonstrates numbered input converted to marks.

Tone 5 represents neutral tone in numbered notation and is generally written without a mark. For example, the package documents Ni3 hao3 ma5? converting to Nǐ hǎo ma?.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Implement a converter for a defined input format

A small converter is practical when your input grammar is narrow and controlled. The vowel rule alone does not define how to parse every possible pinyin string. Decide whether your application accepts space-separated syllables, connected syllables with digits embedded, uppercase letters, punctuation, and malformed input before relying on a conversion routine.

#1 Best Overall
PATIKIL 2Pcs Chinese Keyboard Stickers Chinese-English Keyboard Stickers
  • This Keyboard Sticker is widely used for a variety of keyboards for Computers, Laptops, Notebooks, and Desktops. They are a good replacement for faded or worn letters key, giving the keyboard a different fresh new look. Converting your keyboard keys to another language is well suited for different language communication, education or language self-learning.
  • Full Size: 180mmx65mm/7.1" x 2.6"(L*W); Each Units Size: 13mm x 11mm/0.5" x 0.4"(L*W); Color: Black Background with Orange White Lettering;
  • The PC keyboard sticker is made of durable PVC material, with a matte texture that will provides a better touching and typing experience close to the original keyboard. Each individual keyboard key sticker is cut neatly, and is easy to apply and remove without glue left.
  • Steps of installation: 1)Wipe the dust off the keyboard with a cloth; 2)Tear each keyboard sticker; 3)Paste it on the corresponding key position; 4)Press hard several times to fully fit.
  • All size above is measured by manual, please allow +/-0.1 inch error.

Here is a basic implementation for strings where each syllable ends in a tone digit from 1 to 5. It preserves spaces and punctuation, converts lowercase and uppercase vowels, and leaves units it cannot parse unchanged. It treats v as an alias for ü only if you add that convention explicitly; this example does not.

const toneMarks = {
  a: ["ā", "á", "ǎ", "à"],
  e: ["ē", "é", "ě", "è"],
  i: ["ī", "í", "ǐ", "ì"],
  o: ["ō", "ó", "ǒ", "ò"],
  u: ["ū", "ú", "ǔ", "ù"],
  ü: ["ǖ", "ǘ", "ǚ", "ǜ"]
};

function convertSyllable(unit) {
  const match = unit.match(/^(.*?)([1-5])$/);
  if (!match) return unit;

  const [, syllable, toneText] = match;
  const tone = Number(toneText);
  if (tone === 5) return syllable;

  const vowels = [...syllable];
  const lower = vowels.map(char => char.toLowerCase());
  const target = ["a", "e", "o"].find(vowel => lower.includes(vowel))
    ?? [...lower].reverse().find(char => toneMarks[char]);

  if (!target) return unit;

  const index = lower.indexOf(target);
  const marked = toneMarks[target][tone - 1];
  vowels[index] = vowels[index] === vowels[index].toUpperCase()
    ? marked.toUpperCase()
    : marked;

  return vowels.join("");
}

function convertText(text) {
  return text.replace(/[^s]+/g, convertSyllable);
}

console.log(convertText("Ni3 hao3 ma5?")); // Nǐ hǎo ma?

This example’s tokenization is intentionally simple: it considers every uninterrupted non-space sequence a unit. That is suitable only if each such unit ends in one tone digit. In connected input such as Zhong1guo2ren2, the digits occur within the string, so this parser will not split the syllables correctly. Use a syllable-aware parser or a package for that format rather than assuming arbitrary digits in text are tone numbers.

Rank #2
2PCS Korean Keyboard Stickers with Tweezer, Replacement Korean-English Keyboard Letters Black Background Orange Lettering for Laptops Notebooks PC Computer Desktop, Korean Keyboard Alphabet Sticker
  • 【Wide Compatibility】 This Korean keyboard stickers specially designed for any laptops, notebooks, PC computers, desktops keyboards, wired keyboard, wireless keyboard, such as Logitech, Apple Macbook iMac, HP, Samsung, Acer, Microsoft Surface, Arteck, DELL, ASUS, Lenovo etc. and other keyboards.
  • 【Premium Materials】 The laptop keyboard stickers are made of durable, long-lasting vinyl material with a matte texture finish. The coating is designed to be durable and will not fade even after prolonged use.
  • 【Renew Worn-Out Keyboards】: These keyboard stickers can adhere firmly, clear and easy to read. They can renew faded or worn-out letters, giving your keyboard a brand-new look while saving you the expense of buying a new keyboard!
  • 【Easy to Install and Remove】: This computer keyboard letter sticker is easy to install and remove, leaving no adhesive residue after removal. You can effortlessly convert your keyboard keys to another language, making it simple and quick to use.
  • 【Package Included】 The Korean keyboard stickers letters set includes 2 x Korean Keyboard Stickers, 1 x Tweezer, and 1 x Microfiber Cleaning Cloth, 1 x Keyboard Cleaning Brush, a complete installation kit set for you to install the keyboard stickers quickly and easily.

Validate the behavior your application needs

  • Specify the accepted tone digits and whether digit 5 means neutral tone.
  • Choose how to handle invalid syllables: reject the input, preserve it, or convert only valid units.
  • Decide whether v is accepted as a stand-in for ü, and how capitalization should work.
  • Preserve or deliberately normalize spaces, apostrophes, and punctuation. Apostrophes can disambiguate syllable boundaries.
  • Test syllables with multiple vowels against the placement priority, as well as syllables that need the final-vowel fallback.

Use a JavaScript package when the input is broader

The pinyin-tone-convert project documents npm installation, CommonJS usage, conversion of connected pinyin, and the vowel-placement rule. Check its package registry information and compatibility with your project before adopting it; package recency and maintenance have not been established here.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PinyinJS offers notation helpers such as applyToneMark and toneFromNotation. Its syllable utilities can be used without loading a Hanzi dictionary. Its documentation also exposes choices for tone marks, trailing or superscript numbers, no-tone output, capitalization, punctuation, apostrophes, and grouping. Those options matter when a converter is responsible for formatting whole strings rather than just replacing a vowel in a known syllable.

Rank #3
PATIKIL 3Pcs Chinese English Keyboard Stickers PC Laptop Desktop Computer Clear Background with Black Lettering
  • This Keyboard Sticker is widely used for a variety of keyboards for Computers, Laptops, Notebooks, and Desktops. They are a good replacement for faded or worn letters key, giving the keyboard a different fresh new look. Converting your keyboard keys to another language is well suited for different language communication, education or language self-learning.
  • Full Size: 190mmx70mm/7.5" x 2.8"(L*W); Each Units Size: 13mm x 11mm/0.5" x 0.4"(L*W); Color: Transparent Background with Black Lettering;
  • The PC keyboard sticker is made of durable PVC material, with a matte texture that will provides a better touching and typing experience close to the original keyboard. Each individual keyboard key sticker is cut neatly, and is easy to apply and remove without glue left.
  • Steps of installation: 1)Wipe the dust off the keyboard with a cloth; 2)Tear each keyboard sticker; 3)Paste it on the corresponding key position; 4)Press hard several times to fully fit.
  • All size above is measured by manual, please allow +/-0.1 inch error.

Before selecting a package, check that its documented input and output conventions match your application: connected or separated syllables, neutral-tone handling, punctuation, capitalization, and invalid-input behavior. A library’s existence does not by itself establish that it accepts every pinyin convention your users may enter.

Keep pinyin conversion separate from Hanzi romanization

Number-to-mark conversion takes numbered pinyin as input. It does not read Chinese characters or determine which pronunciation applies in context. PinyinJS documents Hanzi-to-pinyin conversion as a separate, dictionary-based function and notes that readings depend on word context. If your input is Hanzi, you need a lexical conversion step that chooses readings before applying notation formatting.

Rank #4
PATIKIL 3Pcs Chinese Keyboard Stickers Chinese-English Keyboard Stickers Black Background with Blue Lettering for Computer Laptop Desktop 4 Type
  • This Keyboard Sticker is widely used for a variety of keyboards for Computers, Laptops, Notebooks, and Desktops. They are a good replacement for faded or worn letters key, giving the keyboard a different fresh new look. Converting your keyboard keys to another language is well suited for different language communication, education or language self-learning.
  • Full Size: 180mmx65mm/7.1" x 2.6"(L*W); Each Units Size: 13mm x 11mm/0.5" x 0.4"(L*W); Color: Black Background with Blue Lettering;
  • The PC keyboard sticker is made of durable PVC material, with a matte texture that will provides a better touching and typing experience close to the original keyboard. Each individual keyboard key sticker is cut neatly, and is easy to apply and remove without glue left.
  • Steps of installation: 1)Wipe the dust off the keyboard with a cloth; 2)Tear each keyboard sticker; 3)Paste it on the corresponding key position; 4)Press hard several times to fully fit.
  • All size above is measured by manual, please allow +/-0.1 inch error.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Choose a Unicode output and verify rendering

Marked pinyin can be represented with precomposed Unicode characters or with a base vowel followed by a combining diacritic. A browser, font, or downstream text system may render or process those forms differently. The historical Pinyin.info discussion of combining diacritics describes older browser rendering issues; it is not evidence of current browser compatibility. Verify the actual output in the browsers, fonts, and systems your application supports.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a dependable interface, make the output contract explicit: which Unicode representation you produce, whether neutral tone is unmarked, how punctuation and spacing are preserved, and what happens when input cannot be parsed. Then test representative input and output strings in the environments where users will see them.

Quick Recap

Bestseller No. 1
PATIKIL 2Pcs Chinese Keyboard Stickers Chinese-English Keyboard Stickers
PATIKIL 2Pcs Chinese Keyboard Stickers Chinese-English Keyboard Stickers
All size above is measured by manual, please allow +/-0.1 inch error.
$6.89
Bestseller No. 3
PATIKIL 3Pcs Chinese English Keyboard Stickers PC Laptop Desktop Computer Clear Background with Black Lettering
PATIKIL 3Pcs Chinese English Keyboard Stickers PC Laptop Desktop Computer Clear Background with Black Lettering
All size above is measured by manual, please allow +/-0.1 inch error.
$6.99
SaleBestseller No. 5
BOGEEL Traditional Chinese Taiwan Phonetic Keyboard Stickers Hongkong Keyboard Label Sticker Background,PVC
BOGEEL Traditional Chinese Taiwan Phonetic Keyboard Stickers Hongkong Keyboard Label Sticker Background,PVC
This is made from of Eco-environment PVC Printing .; for Adhesive without harmful; Apply for different lapotop and model
$5.04
Best Value
Sale
BOGEEL Traditional Chinese Taiwan Phonetic Keyboard Stickers Hongkong Keyboard Label Sticker Background,PVC
  • This is made from of Eco-environment PVC Printing .
  • for Adhesive without harmful
  • Apply for different lapotop and model
  • The sticker is , so keys color is your keyboard color when you sticker. but the is colored like discreption.
  • Easy to use, you do not have to think apply the stickers.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.