Conventions

Is it important just how you write pinyin? Yes and no. If you are writing it for yourself, then as long as you are consistent, it does not really matter. If you writing to use with other people, then you should follow the conventions in order to avoid any confusion.

The normal convention is to use tone marks rather than numbers to indicate tones. With software today, it is relatively easy to produce them. However, anyone will understand if you write numbers instead. Note that the neutral tone does not have a mark or a number, though occasionally you see a 5 written.

北京、上海、香港我们都去过。
Běijīng, Shànghǎi, Xiānggǎng wǒmen dōu qùguò.
Bei3jing1, Shang4hai3, Xiang1gang3 wo3men dou1 qu4guo4.
We have been to Beijing, Shanghai, and Hong Kong.

When tones change (tone sandhi), only the original tone is reflected, not the change. However, you may see the change in textbooks in order to aid in the proper pronunciation.
你好。Nǐhǎo and not Níhǎo.
一块 yīkuài and not yíkuài
Note also that the first word in the sentence is capitalized.

Note that proper names, such as people and cities, are capitalized, while other words are not. Also, there are no spaces between the pinyin for words (most of which are two characters, but can be three or four).

When there is more than one vowel in the pinyin, the tone mark is placed based on the following order (i.e. it goes on the vowel that comes first in this list): a - o - e - i - u
Examples: hǎo dài wěi xiōng
Exception: for ui and iu it goes over the second, so diū and duī



Recommended Reading

http://pinyin.info/rules/index.html

Complete and Continue