There's a lot of evidence pointing to the economic benefits of adding more legal immigrants to the economy. What's less clear is how much a comprehensive immigration overhaul would affect the federal budget.

While more legal immigrants could cost taxpayers more in health care, education, and other social services, they would also contribute more tax revenues. Ultimately, there will be a lot of political pressure to produce a reform that costs as little as possible, possibly even reducing the deficit in the long term.

(Marvin Joseph -- The Washington Post)

In 2007, the Congressional Budget Office concluded that the Senate's proposed bipartisan immigration reform would increase the deficit by about $18 billion over 10 years, but would have "a relatively small net effect" on the deficit over 20 years.

Here's how that number breaks down: Direct federal spending on immigrants would cost $23 billion over 10 years, mostly because of Medicaid and refundable tax credits. At the same time, the overhaul would generate $48 billion in new revenue, mostly through increased Social Security taxes.

So under the 2007 overhaul, newly legal immigrants would have generated far more revenue than they take in from the government. It's partly because most undocumented immigrants are working age and wouldn't immediately incur major Social Security and Medicare costs. It's also because the 2007 bill required immigrants to pay back taxes and forced them to wait for years before receiving federal benefits.

However, the process of implementing reform itself — setting up a legalization process, new enforcement measures, and so forth — carries its own price tag, of $43 billion over 10 years. So ultimately, CBO estimated that the total cost of the 2007 immigration overhaul was $18 billion.

How would the math work out now? Since neither Congress nor the White House has actually put out a bill, it's not clear. But there are a few things that we do know: Obamacare expanded federal health insurance, and an estimated 7 million undocumented immigrants might theoretically qualify for coverage under its provisions, as my colleague Sarah Kliff explains.

That could add to the cost of immigration reform, depending on how many ultimately became legal citizens and how long they would have to wait to receive benefits. (Both the White House and the Senate gang agree that undocumented immigrants with provisional legal status wouldn't qualify for benefits.) At the same time, it could also introduce a large number of younger, healthier people into insurance pools, which could potentially reduce overall insurance costs, says Michael Fix, senior vice-president of the Migration Policy Institute. "The jury is still really out."

It's also unclear what the cost of implementation will be: As I've reported earlier, we've already hit most of the 2007 targets for border security, at the cost of hundreds of millions of dollars. And the Senate Gang of Eight's plan is vague about what "securing our border" will really mean this time around. Most of the security reforms involve more use of technology, rather than personnel, but the government already has a track record of investing into tech-driven boondoggles in the name of border security.

So the price tag of immigration reform will really depend on legislative debate that Congress has begun to wade into. There will be a lot of pressure on Congress to produce a bill that's either revenue-neutral or will actually reduce the deficit, both by restricting any federal spending on immigrants and limiting the upfront appropriations on implementation.

That's prompted some policy experts to search for new ways that immigration reform could raise revenue — by forcing employers to bid for permits to hire foreign workers, as the Brookings's Hamilton Project explains. But it's also worth remembering that the fiscal calculations don't factor in the ways in which immigration reform benefit the broader economy.