Pinyin (Hanyu Pinyin) is the official romanization for Mandarin in mainland China since 1958. It’s used for:
It’s not a replacement for characters—Chinese literacy requires hanzi. Other systems exist (Wade-Giles, Yale, Zhuyin/Bopomofo in Taiwan), but Pinyin dominates globally and domestically.