Legally, you are required to have it on you at all times.
According to Article 38 of the Exit and Entry Administration Law of the People's Republic of China:
•Foreigners aged 16 or older who stay or reside in China shall carry with them their passports or other international travel documents, or foreigners’ stay or residence permits, and accept the inspection of public security organs.
•Foreigners who reside in China shall, within the prescribed time limit, submit foreigners’ residence permits to public security organs under local people’s governments at or above the county level in the places of residence for examination.
So yes, you need to carry your passport with you to board trains and other public transportation vehicles, check into hotels, and enter major tourist attractions like the Forbidden City – in fact you must carry it with you everywhere.
Sources: National Immigration Administration
(Information updated in January, 2026)