HANGZHOU, China—Swiping her son’s half-fare student card through the turnstile here one Monday afternoon, Chen Li earned herself a $6 fine and a reprimand from a subway-station inspector for not paying the adult fare.

A notice on a post nearby suggested more-dire consequences. It warned that infractors could be docked points in the city’s “personal credit information system.” A decline in Ms. Chen’s credit score, according to official pronouncements, could affect her daily life, including securing loans, jobs and her son’s school admission.

“I’m sure if it comes up, I can explain,“ Ms. Chen said, saying she picked up the card accidentally. “It was unintentional.”

Hangzhou’s local government is piloting a “social credit” system the Communist Party has said it wants to roll out nationwide by 2020, a digital reboot of the methods of social control the regime uses to avert threats to its legitimacy.

More than three dozen local governments across China are beginning to compile digital records of social and financial behavior to rate creditworthiness. A person can incur black marks for infractions such as fare cheating, jaywalking and violating family-planning rules. The effort echoes the dang’an, a system of dossiers the Communist party keeps on urban workers’ behavior.