Much of the debate over legalizing gay marriage has focused on God and Scripture, the Constitution and equal protection.

But we see the world through the prism of money. And for years, we’ve heard from gay couples about all the extra health, legal and other costs they bear. So we set out to determine what they were and to come up with a round number  a couple’s lifetime cost of being gay.

It was much more complicated than we initially imagined, and that’s probably why we’ve never seen similar efforts. We looked at benefits that routinely go to married heterosexual couples but not to gay couples, like certain Social Security payments. We plotted out the cost of health insurance for couples whose employers don’t offer it to domestic partners. Even tax preparation can cost more, since gay couples have to file two sets of returns. Still, many couples may come out ahead in one area: they owe less in income taxes because they’re not hit with the so-called marriage penalty.

Our goal was to create a hypothetical gay couple whose situation would be similar to a heterosexual couple’s. So we gave the couple two children and assumed that one partner would stay home for five years to take care of them. We also considered the taxes in the three states that have the highest estimated gay populations  New York, California and Florida. We gave our couple an income of $140,000, which is about the average income in those three states for unmarried same-sex partners who are college-educated, 30 to 40 years old and raising children under the age of 18.

Here is what we came up with. In our worst case, the couple’s lifetime cost of being gay was $467,562. But the number fell to $41,196 in the best case for a couple with significantly better health insurance, plus lower taxes and other costs.

These numbers will vary, depending on a couple’s income and circumstance. Gay couples earning, say, $80,000, could have health insurance costs similar to our hypothetical higher-earning couple, but they might well owe more in income taxes than their heterosexual counterparts. For wealthy couples with a lot of assets, on the other hand, the cost of being gay could easily spiral into the millions.

Nearly all the extra costs that gay couples face would be erased if the federal government legalized same-sex marriage. One exception is the cost of having biological children, but we felt it was appropriate to include this given our goal of outlining every cost gay couples incur that heterosexual couples may not.

Our analysis is not exact science. Not every couple would get married if they could, and others would not want to have children. We also made a number of assumptions based on average costs, life spans, state of residence and gender.

Our gay family is made up of two women living in New York State in a committed partnership that lasts 46 years, until the first partner dies at age 81. We ran two sets of calculations: in the one that turned out to be our worst case financially, one woman earned $110,000 and the other $30,000. In our second couple, both partners earned $70,000. We started running the numbers when both were age 35.

We received assistance from Roberton Williams, a senior fellow at the Tax Policy Center, who performed our tax analysis, which required simulating more than 900 income tax returns, in part because we followed the partners for 50 years. We also decided to run all scenarios across the three states so that the results would not be skewed by different state taxes. We’ve outlined all the detail in a workbook linked to the online version of this column.

As for the emotional costs of living with these added complexities, they can’t be quantified. Frederick Hertz, a lawyer in Oakland, Calif., who works with same-sex couples, likens heterosexual marriage to being in the car pool lane. “Being part of a same-sex couple, it’s always stop. Wait. Pay a toll,” he said.

Harvey Hurdle, who lives in Philadelphia with his partner and their young son, said he was reminded of the disparities every time his Social Security statement arrived in the mail. “It’s pretty insulting,” he said. “It says your spouse would get this much. And it’s like, ‘Oh no he won’t!’ ”

Health Insurance

In our worst case, the lower earner’s employer did not provide health insurance and her partner’s employer didn’t cover domestic partners. So the lower earner had to buy coverage on the private market, while the higher-earning partner provided coverage for herself and the two children. All this cost the gay couple $211,993 more than their heterosexual married counterparts, who were able to take advantage of the higher-earner’s family coverage.

In our best case, health coverage cost the gay couple $28,595 more. We assumed both gay partners were eligible for employer-provided coverage. The higher-earner’s employer also provided domestic partner coverage, which covered her partner for the five years she stayed at home. When she returned to work, she used her own employer’s insurance.

Even though the couple paid nearly $29,000 more in premiums than an identical heterosexual married couple, it was cheaper than using domestic partnership coverage throughout because of the onerous tax implications, according to Mr. Williams of the Tax Policy Center. A nondependent partner’s coverage is taxable income, and she can’t use pretax dollars to pay the premiums, according to Todd A. Solomon, a partner in the employee benefits department of McDermott Will & Emery in Chicago.

Social Security

All our hypothetical individuals started collecting Social Security when they were 66. Same-sex couples are not entitled to a variety of Social Security benefits, including spousal benefits (heterosexual spouses can receive up to 50 percent of a spouse’s benefits while the spouse is alive, if they are higher than their own); survivor benefits (surviving spouses can receive their deceased spouse’s benefits in lieu of their own, if they are higher); and a flat death benefit of $255.

In the worst case, the gay partner who earned $30,000 could not receive higher spousal benefits or survivor benefits from her partner’s much higher earnings record. Nor was she entitled to the death benefit. In total, the gay women collected $88,511 less in Social Security than a similar heterosexual couple. Some couples might try to buy life insurance in an attempt to replace the benefit.

Image Two-year-old Evan plays with his dads, Kevin Yoder, right, and Harvey Hurdle at their Philadelphia home. Credit... Laura Pedrick for The New York Times

In our best case, when the gay partners had largely identical incomes, neither was at a huge disadvantage because they ended up with about the same monthly benefits. So the only extra benefit a heterosexual married couple received was the $255 death benefit.

Estate Taxes

Heterosexual married couples can transfer an unlimited amount of assets to each other during their lives and at death without paying estate taxes. Everyone else, including married same-sex couples, must pay federal estate taxes on amounts that exceed the 2009 exemption of $3.5 million. Many states also levy their own estate or inheritance taxes, though same-sex couples may be shielded from those in states that recognize their unions. Our couple lived in New York, where the estate tax exemption is $1 million. And though New York recognizes marriages performed elsewhere, that recognition does not extend to state income or estate taxes.

In our worst case, the gay partner who died first in 2055 left an estate that exceeded the state’s threshold by $171,528. That meant a tax bill of $43,378, according to Ron L. Meyers, an estate-planning lawyer with a significant same-sex clientele at Cane, Boniface & Meyers in Nyack, N.Y.

Meanwhile, their identical heterosexual counterparts owed nothing.

The gay couple in our best case had a smaller estate, in part because they were careful to title their home as tenants-in-common, so only the deceased partner’s half of the home was taxable. The estate didn’t exceed the federal or state threshold. So they owed nothing.

Childbearing

Two women who want to have a biological child together need sperm to do it. They may need to purchase sperm from a bank and use a medical professional to inseminate one of the partners. There are also adoption costs.

The worst case here totaled $40,000. It included 12 months of sperm and insemination costs, but the big wild card was the possible need to move to a state where same-sex second-parent adoptions were legal. While this may seem extreme, couples often do it, according to Joyce Kauffman, a lawyer in Cambridge, Mass., who has worked with many of them. We estimated a minimum of $20,000 for this cost, including real estate brokerage fees to sell a home and moving costs.

In the best case, there might be no cost at all: the couple could use sperm from a relative of the partner who isn’t bearing the child or from a friend, inseminate at home and take their chances with free legal forms on the Web. Ms. Kaufman does not recommend such a cavalier approach to vital documents.

The cost for men to have a biological child would be much higher if they used a surrogate.

Pension

We assumed that one partner, in both best and worst cases, received a small pension. In both cases, the partner with the pension plan died first.

Employers do not have to provide survivor pension benefits to a same-sex spouse, but many do anyway (which would put our best case at $0). In our worst case, however, the higher-earning partner died first and did not work for such a company. So the surviving partner got nothing. A similarly situated heterosexual surviving spouse would receive $32,253 before dying herself several years later.

Spousal I.R.A.

You generally need to earn income to contribute to an Individual Retirement Account. But heterosexual married couples can contribute up to $5,000 annually to a spousal I.R.A. for a nonworking spouse. Stay-at-home gay partners, however, cannot make these contributions. So they end up with smaller retirement accounts.

We assumed that all the couples would have either saved 7 percent of the stay-at-home parent’s previous year’s salary, or $5,000, the maximum contribution. So the gay couple with one partner who started out earning just $30,000 would have saved less (had she been legally able to) than someone earning $70,000. In both cases, that five-year gap in savings early on in the partners’ lives haunted them later because they weren’t able to benefit from decades of compounding returns.

The couple with the lower-earning partner at home ended up $48,654 behind by the time that partner died, assuming she invested in a portfolio mixed equally between stocks and bonds that returned 5.94 percent annually. The surviving spouse from the gay couple with equal incomes ended up $112,192 behind.

Tax Preparation

Instead of filing one joint federal tax return and one state income tax return, same-sex couples must file two sets of returns. In both best and worst cases, those couples paid an additional $12,300 in tax preparation fees over the 46 years they are together.

Financial Planning

Even married same-sex couples are encouraged to create a number of documents that try to replicate the protections and rights of heterosexual marriage because their unions are not universally recognized. In the worst case, our gay couple spent $5,500 more than their heterosexual counterparts on their additional paperwork. That included a revocable living trust, which is more difficult to contest than a will, and what is known as a pour-over will, which ensured that anything left out of the trust would be included. They also each set up financial powers of attorney, health care proxies, living wills and a domestic partnership agreement.

In the best case, our couple didn’t spend any more than a prudent heterosexual couple would. Both couples created two wills, financial powers of attorney, health care proxies and living wills.

Income Taxes

Married heterosexual couples with two working spouses with similar incomes often pay more in federal taxes than if they remained single because of the so-called marriage penalty. This occurs when a couple’s combined income pushes them into a higher tax bracket than they would have been in if they filed as singles. But some couples  especially those with a wide disparity in income or with a stay-at-home parent  usually pay less when they file jointly. They benefit from what’s known as a marriage bonus.

In our worst case, where one gay partner earned $110,000 and one earned $30,000, the couple paid $15,027 less in taxes over their lifetimes than their heterosexual counterparts.

Though the gay and heterosexual married couple had identical salaries, the married couple collected more income in retirement  a direct result of their marriage status  and thus owed more in taxes (though they still benefited from the marriage bonus). For instance, the married couple collected higher Social Security spousal benefits and survivor benefits, pension income and income derived from a spousal I.R.A. The gay couples weren’t entitled to any of these benefits.

In our best case, where the partners each earned $70,000, the gay couple paid $112,146 less in income taxes. “That is the marriage penalty rearing its ugly head,” Mr. Williams said.