In an analysis for ProPublica, Adam Ozimek and Mark Zandi at Moody’s Analytics , an independent economics firm, estimated that for every 1 percent increase in U.S. population made of immigrants, GDP rises 1.15 percent. So a simple way to get to Trump’s 4 percent GDP bump? Take in about 8 million net immigrants per year. To show you what that really looks like, we’ve charted the effect below. You can see for yourself what might happen to the economy if we increased immigration to the highest rates in history or dropped it to zero – and everything in between.

“Immigration is a great economic policy opportunity and it’s important to document the impact of that,” said Douglas Holtz-Eakin, an economist who served on the President’s Council of Economic Advisers in both Bush administrations. He agreed with the basic conclusions of Moody’s analysis, and said that 1.15 percent was a reasonable estimate of the effect of immigration on GDP.

“You can’t just flip a switch and make the U.S. a richer place,” said Ozimek, the economist at Moody’s Analytics who worked on the analysis. “But with immigration, you can flip a switch and massively grow the size of the country.” And while other policy changes may have subtle, indirect effects on the economy, there is a very straightforward relationship between growing the size of the country and growing the GDP (we’re referring to overall GDP, not per-capita GDP, which the analysis does not address).

It may seem like a basic point: Adding immigrant workers means the economy is larger, with more people earning wages and buying goods and services. But that fact may come as a surprise to a lot of people, said Jennifer Hunt, an economist at Rutgers University. Many Americans assume that immigrants have zero effect on the economy, or think that immigrants subtract value from an economic pie of fixed size. In fact, immigrants make the pie bigger. According to a recent paper by economists Ryan Edwards of Mills College and Francesc Ortega of Queens College CUNY, even undocumented immigrants spur growth.

Using the paper’s methods, we calculated that deporting the estimated 11.3 million undocumented people in this country would be an almost $8 trillion hit to the economy over the next 14 years. Legalizing them could boost GDP by almost $2 trillion in that same time period. You can see what these hypothetical scenarios would look like in our chart above.

Immigrants Spur Growth but not Without Some Costs

The debate over whether immigrants take the jobs of Americans has only become more heated in the past few years, and was a major issue throughout the 2016 presidential campaign. Studies suggest that immigrants do not threaten the wages or jobs held by most Americans. A recent report from the National Academies of Sciences, Engineering and Medicine found “little evidence that immigration significantly affects the overall employment levels of native-born workers.” While not all people are affected by immigration the same way (for example, high school dropouts stand to lose more than business owners) many studies have concluded the same thing: that immigrants by and large don’t displace native-born Americans, and in fact sometimes actually create more jobs for the people already in this country.

As labor economist Pia Orrenius explains, when immigrants enter the labor force they can actually raise the incomes of natives. This “immigration surplus” is usually small, typically .2 to .4 percent, but that still amounts to about $50 billion per year. Immigrants also tend to be more mobile, moving to places that need workers, tend to be more entrepreneurial and innovative, which boosts economic growth for years, and often work in roles complementary to native-born Americans, which makes everyone more productive.

Moody’s analysis did not take into account the fiscal costs of adding more immigrants to the country: the cost of providing public goods like education, health care, welfare benefits, etc. Calculating the costs of an ever-changing group of people is incredibly complex, and estimates vary widely based on assumptions about immigrants’ average age, education level, number of children, and even legal status.

As a whole, immigrants tend to have more children, which means that state and local governments bear the burden of providing education. They also tend to have lower earnings, which means they pay less in taxes. The National Academies report found that in most scenarios, immigrants take in more in public services than they pay in taxes, especially at the state and local level. That said, because today’s immigrants are younger, working, and have more education than earlier immigrants, they “tend to be beneficial to federal finances in the short term,” according to the report. Because federal benefits largely go to the elderly, the people who really subtract from the budget, according to Hunt, are retired and collecting Social Security.

While the analysis leaves out the potential fiscal cost of allowing millions of immigrants into the country, it also leaves out a number of factors that have positive effects: productivity benefits spurred by innovation and immigrant entrepreneurship, as well as the positive effects on housing markets (immigrants are more likely to be homebuyers and account for much of the household growth over the past two decades.)

A Historically Unprecedented Solution

Immigration is not just a simple way, it may be the only budgetarily achievable way to reach 4 percent growth. Hunt, Holtz-Eakin, and other economists we interviewed agreed that barring a massive and expensive change in policy (for example, increasing child care subsidies or expanding the earned income tax credit), it would be next to impossible for Trump to reach his goal without immigration.

“Three percent is the outer limit of what is feasible without changing immigration,” said Holtz-Eakin.

At some points in U.S. history, notably the 1990’s, the country did see a period of high economic growth that did not depend on immigration. “The 90’s were a special decade,” said Giovanni Peri, a labor economist at The University of California, Davis. The 4 percent growth at that time had more to do with increased productivity because of technological advances, innovation, and tax policy. Immigration did contribute to the growth, according to Peri, but only a portion. Fast forward to today, where conditions are very different, and immigration becomes our only option to repeat such high growth.

That runs directly into political reality, which is that Trump’s base, and indeed much of his campaign rhetoric, was focused on voters who view immigrants as a threat to their livelihoods. Immigration does not usually come up when Trump speaks on the subject of economic growth. On the campaign trail, Trump repeatedly claimed that his policies would grow the economy by 3, 4, or even as high as 6 percent a year. In the third presidential debate Trump said, “I actually think we can go higher than 4 percent. I think you can go to 5 percent or 6 percent.” Today, the White House website states that Trump has “a bold plan to create 25 million new American jobs in the next decade and return to 4 percent annual economic growth.” Trump often brings up tax and regulatory reforms to explain how he’d reach such high numbers; immigration is seldom mentioned.

When the Trump administration mentions immigration, it’s almost always in the context of limiting it. In fact, according to Politico, Trump is backing a law that would cut legal immigration by half over the next decade.

A look at the historical record illustrates the magnitude of the dilemma that faces the administration. The rates of immigration Moody’s analysis suggests are needed to spur annual growth rates of 4 percent – about 8 million net immigrants a year – are an anomaly in America’s oscillating view of admitting foreigners.

“This has never happened in the history of the United States as we know it,” said labor economist Peri, who wrote recently about how immigration boosted both population and productivity between 2000 and 2015. Even during periods of extremely high immigration such as during the late 1990’s and early 2000’s, and including estimates of unauthorized immigrants, the U.S. only took in around 2 million immigrants per year.

Because immigration levels higher than about 1 million to 2 million per year are historically unprecedented, it’s difficult to predict how they might affect the economy. Experts point out that these hypothetical scenarios raise a number of questions: Where would all these immigrants come from? How skilled or unskilled might they be? How would the U.S. economy adjust to provide them with capital?

“None of these questions seem likely to have an answer that would get us into a practically Trumpian world of 4 percent real growth,” said economist Edwards.

Why More Immigrants Translate into a Higher GDP, or How Our Chart Works

Let’s back up a little bit and take a look at how U.S. economic growth is calculated in the first place. Two important factors that go into the equation are the number of people in the labor force and how productive they are. In the past 50 years, we’ve had an average GDP growth of around 3 percent, about half of which came from a growing labor force and half from their productivity (more recent years have hovered closer to 2 percent).

But because of our retiring Baby Boom generation and falling fertility rates, the growth rate of the labor force is dropping fast. According to Pew Research Center, the projected growth rate for the total working-age adult population will average just .3 percent for the next two decades – and the only reason that number goes up at all is because of new immigrants. Without them, by 2035 the working age population would go down by 8 million people. In other words, if no one replaced those retiring workers, the U.S. working age population would drop by more than 4 percent in just two decades. The only certain way to reverse that trend is with immigration.

Typically the labor force’s contribution to the economy is a 1:1 ratio – increase the labor force 1 percent, GDP goes up 1 percent. So in order to calculate immigrants’ effect on the economy, one needs to determine how immigrants as a group compare to the rest of the population as a whole. Moody’s found that while immigrants work in a huge variety of fields, from low-skilled field labor to high-skilled tech jobs, as a whole they cluster in industries with lower than average output. At the same time, immigrants in the U.S. tend to be of working age and generally come here to work, so as a group they have more workers than average. Overall, these two factors together mean that immigrants pull a little more weight than native-born Americans when it comes to GDP – specifically 1.15 times as much.

Now, there are a number of assumptions in this calculation. For one, Moody’s does not directly distinguish between documented and undocumented immigrants, but rather uses Census data to look at the mix of industries that immigrants who moved here in the last 10 years work in. This is an indirect measure of their combined effect on the economy.

A second assumption is that immigrants in the future will be similar to immigrants today: same mix of industries, same mix of low- and high-skilled labor. But this could change. For example, if Congress passed legislation dramatically decreasing visas allotted to low-skilled workers while increasing them for high-skilled workers in Silicon Valley, the economic boost provided by additional immigrants could be much greater.

“In some statements, Trump wants to ‘pause’ immigration,” said Ozimek of Moody’s Analytics, “and in other statements he talks about letting only the ‘best’ people come here.” It’s difficult to predict the outcome on real immigration with such contradictory statements.

Of course, immigration is just one of many factors that could affect future GDP. So we’ve combined this “immigration effect” with Moody’s Analytics’ GDP forecast. Their baseline forecast takes into account a number of other factors that can affect future GDP growth, including U.S. population, fertility and mortality rates, labor force participation rates and short-term recovery effects. Slight differences in each of these factors could change the projected GDP in each scenario, especially in the short term. However, all the economists we interviewed agreed that it would take a very substantial policy shift to significantly change growth in the long term.

You can read more about Moody’s forecast assumptions in their recent economic report.

Deporting Unauthorized Immigrants is a Huge Hit to the Economy, Legalizing Them is a Boon

In his campaign, Trump once floated the idea of deporting all 11 million unauthorized immigrants. It remains to be seen whether he’ll attempt to carry out such massive deportations. As the administration weighs whether to do this, economists say it should be aware that removing so many people at once would have a significant economic effect. We calculated a total GDP loss of almost $8 trillion over 14 years, using methods outlined in a recent paper by Edwards of Mills College and Ortega of Queens College CUNY.

Edwards and Ortega focused their analysis on the estimated 11.3 million unauthorized immigrants in the country, of which roughly 7.1 million are workers. Deporting all of them would result in an almost unprecedented 5 percent loss of the workforce, a reduction in national employment similar to what occurred during the Great Recession.

The paper argues that legalizing these undocumented immigrants would have the opposite effect, boosting GDP by .6 percent, or a cumulative gain of $1.8 trillion over the next 14 years. That’s because immigrants without legal status have limited options for work, often forgoing higher-paying jobs that match their skills because of paperwork requirements or fear of revealing their status. That “productivity penalty” is one thing that legalization could make up for.

Ortega said that the paper’s estimate is conservative because it assumes that gaining legal status would make unauthorized immigrants only as productive as other immigrants with the same education. But some studies have shown that when unauthorized immigrants gain legal status, they actually become more productive than those who came legally, investing in more skills and training. Even with these assumptions, the paper forecasts that legalization would increase the economic contribution of the unauthorized population by about 20 percent.

The authors chose not try to calculate the additional enormous cost of logistically locating and deporting millions of people, which some have estimated to be between $400 billion and $600 billion.

It’s Not Only About GDP

Of course, the question of how immigration impacts GDP is a small slice of a much broader question of how immigrants and immigration policies affect our economy. Steven Camarota, the director of research for the Center for Immigration Studies, points out that a key question in any hypothetical scenario is whether the native born population is better off. A massive increase in immigrants may add to the size of the U.S. economy, but that doesn’t necessarily make things better for the people already here.

Increased immigration has differing effects depending on education and industry. The National Academies report suggests that some low-skilled workers (such as high school dropouts) who compete with low-skilled immigrants will lose wages and income even as business owners and investors profit from the overall growth in the economy. As Harvard economist George Borjas explains, the people who compete with immigrants are losing out to the people who employ immigrants.

Those nuances are often hidden in the overall employment numbers. According to Rutger’s Hunt, when economists talk about the effect of immigration on jobs, they ask whether the employment rate for natives has fallen or risen. And from a national perspective, there is broad agreement that increased immigration does not meaningfully change overall employment rates. But those numbers don’t capture people who are forced to change jobs, for example American workers who share job qualifications with immigrant workers and might be forced to move to lower-paying or less desirable jobs. For those individuals, the effect of immigration can be life-changing.

“Generally when it comes to immigration there are winners and losers,” said Michael Ben-Gad, a economics professor at City, University of London, “and those differences tend to be much, much bigger than a net number like GDP.”

As mentioned earlier, even if immigrants increase GDP, the cost of providing public services like health care, education and welfare benefits must also be taken into account. The National Academies report found that, in general, first-generation immigrants are more costly to governments, mainly at the state and local levels, than native-born generations. However, immigrants’ children “are among the strongest economic and fiscal contributors in the population.”

“Immigration is not a panacea, and it’s not going to cure all our ills,” said Jeremy Robbins, executive director of New American Economy, “but it is by and large good for economic growth...and a net positive for the country by far.”