Protesters gather in Long Island City to say "No" to the Amazon "HQ2" decision on November 14, 2018 in Long Island City, New York. - It
Protesters gather in Long Island City to say "No" to the Amazon "HQ2" decision on November 14, 2018 in Long Island City, New York. - It's exciting for some, worrisome for others: The arrival of a massive headquarters of technology giant Amazon in two East Coast communities is certain to bring huge changes. Amazon announced Tuesday after a yearlong search that it would split its "HQ2" between Arlington, Virginia, outside the US capital, and the Long Island City neighborhood in the New York borough of Queens. (Photo by Don EMMERT / AFP) (Photo credit should read DON EMMERT/AFP/Getty Images)
PHOTO: DON EMMERT/AFP/Getty Images
Now playing
03:32
Amazon should have seen this coming
Now playing
01:25
This robotaxi from Amazon's Zoox has no reverse function
Now playing
02:52
AWS CEO: Businesses are reinventing rapidly
PHOTO: Amazon
Now playing
00:57
Watch Ring's indoor drone prototype patrol a house
Dr. Michael Pecht of the University of Maryland
Dr. Michael Pecht of the University of Maryland's Center for Advanced Life Cycle Engineering looks at an AmazonBasics microwave from a customer who said it caught on fire.
PHOTO: Heather Fulbright/CNN
Now playing
04:23
Dozens of AmazonBasics product are flagged as dangerous, but many are still being sold
The new Amazon Halo fitness band
The new Amazon Halo fitness band
PHOTO: Amazon
Now playing
01:10
See Amazon's new wearable it says can tell if you're stressed out
PHOTO: CNN
Now playing
07:35
We bought a car seat on Amazon. It shattered in a crash test
TOPSHOT - The US Capitol is seen in Washington, DC on January 22, 2018 after the US Senate reached a deal to reopen the federal government, with Democrats accepting a compromise spending bill. / AFP PHOTO / MANDEL NGAN        (Photo credit should read MANDEL NGAN/AFP/Getty Images)
TOPSHOT - The US Capitol is seen in Washington, DC on January 22, 2018 after the US Senate reached a deal to reopen the federal government, with Democrats accepting a compromise spending bill. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images)
Now playing
02:22
Will the government attempt to break up Amazon?​
ROBBINSVILLE, NJ - AUGUST 1:  Boxes travel on conveyor belts at the Amazon Fulfillment Center on August 1, 2017 in Robbinsville, New Jersey.  The more than 1 million square feet facility holds tens of millions of products, features more than 14 miles of conveyor belts, and employs more than 4,000 workers who pick, pack, and ship orders.  Tomorrow Amazon will host a jobs fair to hire 50,000 positions in their fulfillment centers nationwide.  (Photo by Mark Makela/Getty Images)
ROBBINSVILLE, NJ - AUGUST 1: Boxes travel on conveyor belts at the Amazon Fulfillment Center on August 1, 2017 in Robbinsville, New Jersey. The more than 1 million square feet facility holds tens of millions of products, features more than 14 miles of conveyor belts, and employs more than 4,000 workers who pick, pack, and ship orders. Tomorrow Amazon will host a jobs fair to hire 50,000 positions in their fulfillment centers nationwide. (Photo by Mark Makela/Getty Images)
PHOTO: Mark Makela/Getty Images/FILE
Now playing
04:14
Is Amazon a monopoly?
LAS VEGAS, NV - JUNE 06: An Amazon truck leaves the Amazon regional distribution center on June 6, 2019 in Las Vegas, Nevada. Amazon is expanding into more self delivery of their packages. (Photo by George Frey/Getty Images)
LAS VEGAS, NV - JUNE 06: An Amazon truck leaves the Amazon regional distribution center on June 6, 2019 in Las Vegas, Nevada. Amazon is expanding into more self delivery of their packages. (Photo by George Frey/Getty Images)
PHOTO: George Frey/Getty Images
Now playing
02:35
Protests and competitors take aim at Amazon Prime Day
SANTA MONICA, CA - SEPTEMBER 6:  Amazon CEO Jeff Bezos holds a new front-lit Kindle Paperwhite 3G reading device during a press conference on September 6, 2012 in Santa Monica, California.  Amazon unveilved the Kindle Paperwhite and the Kindle Fire HD in 7 and 8.9-inch sizes. (Photo by David McNew/Getty Images)
SANTA MONICA, CA - SEPTEMBER 6: Amazon CEO Jeff Bezos holds a new front-lit Kindle Paperwhite 3G reading device during a press conference on September 6, 2012 in Santa Monica, California. Amazon unveilved the Kindle Paperwhite and the Kindle Fire HD in 7 and 8.9-inch sizes. (Photo by David McNew/Getty Images)
PHOTO: David McNew/Getty Images North America/Getty Images
Now playing
02:42
These industries could be Amazon's next targets
PHOTO: Photo-Illustration: Shutterstock/CNNMoney
Now playing
02:41
Can Amazon afford to get into the ad business?
PHOTO: Photo-Illustration: Getty/Shutterstock/CNNMoney
Now playing
02:16
Will Bezos ever leave Amazon?
SEATTLE, WA - JANUARY 22: A shopper scans the Amazon Go app upon entetering the Amazon Go store, on January 22, 2018 in Seattle, Washington. After more than a year in beta Amazon opened the cashier-less store to the public. (Photo by Stephen Brashear/Getty Images)
SEATTLE, WA - JANUARY 22: A shopper scans the Amazon Go app upon entetering the Amazon Go store, on January 22, 2018 in Seattle, Washington. After more than a year in beta Amazon opened the cashier-less store to the public. (Photo by Stephen Brashear/Getty Images)
PHOTO: Stephen Brashear/Getty Images North America/Getty Images
Now playing
04:27
Amazon is using AI in almost everything it does
PHOTO: Amazon
Now playing
01:50
Is an Amazon employee listening to you?
PHOTO: Sofia Ordonez/CNN
Now playing
04:24
What happens when Amazon comes for your business?
(CNN Business) —  

Amazon hasn’t paid any taxes to the US government in the past two years. Actually, Amazon received hundreds of millions of dollars in federal tax credits in 2017 and 2018.

That might seem nuts, considering Amazon is the third-most valuable company in the world and earned a record $10 billion last year. But critics of Amazon’s tax bill aren’t accusing Amazon of doing anything improper.

“This is tax avoidance, not tax evasion. There’s no indication of any wrongdoing, except on the part of Congress,” said Matthew Gardner, senior fellow at the Institute on Taxation and Economic Policy, a liberal think tank.

US tax code allows money-losing companies to reduce their future taxable income.

Amazon (AMZN) piled up billions of dollars in losses over its two-decade history. It posted $3 billion worth of losses during its first eight years as a public company. It swung between profit and loss since 2003. Its most recent annual loss was $241 million in 2014.

Amazon’s total earnings have easily topped its losses — many times over. But some of Amazon’s earnings came from sales outside the United States, on which Amazon paid either lower or no US taxes. Other earnings were offset by Amazon’s investments in equipment, such computers and robots at its fulfillment centers.

Last year, Amazon benefited from an accelerated tax credit for equipment purchases, which was part of the corporate tax bill passed at the end of 2017. And the company has received research and development tax credits. So Amazon’s federal tax bill came to a net credit of $129 million in 2018 after getting a $137 million tax credit in 2017.

The company said in its most recent annual financial statement that it still has $1.4 billion in federal tax credits available to offset future tax bills.

Many companies that lose money pay little or no federal income taxes. For example, General Motors has paid little federal tax money since emerging from bankruptcy in 2009, despite posting record profits for several years. GM (GM) doesn’t anticipate having to pay any significant federal tax for years to come.

Amazon, by contrast, paid $1.1 billion in federal taxes in 2016.

The company has also paid non-federal taxes. Amazon paid $533 million in state taxes and $1.3 billion in international taxes over the past two years.

Proponents of the federal tax law argue the tax credits for past losses, equipment purchases and research and development allow companies to invest for the future and grow.

“Amazon is a powerhouse company and it got there because it invested extensively,” said Mark Zandi, chief economist at Moody’s Analytics. “Most of our policies are much too short cited. This is one policy that rewards a longer-term perspective and taking some risk. Because of that, Amazon will ultimately be a big payoff for taxpayers.”

But Gardner said Amazon’s success makes such tax breaks unnecessary.

“It’s hard to see a compelling argument that they would have been hamstrung in their ability to create jobs if they had been forced to pay taxes like everyone else does,” said Gardner.

Amazon declined to comment on its federal tax payments.

The company announced it would drop plans to create 25,000 jobs in New York because of political backlash to the $1.5 billion in tax incentives being offered by the city and the state. The tax breaks it receives from the federal government are more valuable, but have gotten a lot less attention.