The law states that “no employer shall discriminate in any way on the basis of gender in the payment of wages, or pay any person in its employ a salary or wage rate less than the rates paid to its employees of a different gender for comparable work.” In addition, it prohibits employers from disciplining workers for discussing their salaries with colleagues or asking job applicants for their salary history.

(Massachusetts is not the first state to pass a pay equity law. In recent years, many states have been working to pass or strengthen their laws, including North Dakota, Illinois and Oregon. But none of those states has gone quite as far as Massachusetts.)

With employers, workers and policy all working toward the same goal, Boston is trying to succeed in an arena where decades of advocacy, research and good intentions have failed.

“If we just had the legislation, and employers weren’t acting and women weren’t asking, then it’s going to close the gap a little bit but not enough,” said Megan Costello, executive director of the Mayor’s Office of Women’s Advancement. “It has to be all of these things together.”

A report last year by the Boston Women’s Workforce Council, a public-private partnership, examined data from 114 companies that have pledged to close any pay gaps in their firms, covering 16 percent of the workers in the city, or nearly 167,000. It showed that women earned an average of $73,327 to men’s $97,062, or 76 cents to the male dollar, less than the national average of about 80 cents. (As with recently released pay data from Britain, the gap can be partly explained by the higher concentration of men in senior roles.)