“We said, ‘You’re right, that doesn’t seem fair,’ so we looked into it,” Mr. Bock said. “From that initial suggestion, we said, let’s take a look at all the benefits we offer and see if we are being truly fair across the board.” As a result, the company also decided to make a few other changes that would help gay employees, including eliminating a one-year waiting period before qualifying for infertility benefits and including domestic partners in its family leave policy  going beyond the federal Family and Medical Leave Act, which requires employers to provide up to 12 weeks’ leave in a one-year period to recover from a medical condition or to care for a relative.

Image Google is trying to eliminate the added tax burden for employees like Bennet Marks, left, and his husband, Kim Harris. Credit... Peter Dasilva for The New York Times

The extra compensation to cover the domestic partner tax will apply only to same-sex domestic partners, Mr. Bock said, because heterosexual couples can avoid the added tax by marrying. (Same-sex couples can make their unions official in several states, but their relationship will not be federally recognized.)

The additional pay will also cover the dependents of the employee’s domestic partner. The changes will be retroactive to Jan. 1, and will apply only to workers in the United States.

It is hard to say how many of Google’s 20,600 employees will be affected by the changes, but the company’s internal gay and lesbian group  they call themselves Gayglers  has about 700 members (though some members may simply support their gay and lesbian co-workers).

So what’s the cost of Google’s largess? Mr. Bock declined to provide details but said the decision was less about money and more about equalizing benefits. “If you were to add it all up, it’s not like we are talking hundreds of thousands per employee,” he said. “It will cost some money, but it was more about doing the right thing.”

The Kaiser Family Foundation says that 36 percent of large companies that offer health benefits provide coverage for same-sex domestic partners, and more than half of Fortune 500 companies provide domestic partner coverage  but few pay the extra costs of that coverage.