SEATTLE, WA - OCTOBER 11: Amazon.com founder and CEO Jeff Bezos attends a launch event for the Bezos Center for Innovation at the Museum of History and Industry on October 11, 2013 in Seattle, Washington. Supported by Jeff and MacKenzie Bezos, the center aims to highlight the history and future of innovation in the Puget Sound region. (Photo by David Ryder/Getty Images)

Amazon.com is the best-loved company in America, despite being very similar to one of the least-loved companies in America: Walmart.

The Internet megastore had the best public image of any U.S. company in 2013, according to a study released on Monday by YouGov, a market-research firm based in the U.K. YouGov surveyed about 1.2 million people online over the course of 2013 to come up with its rankings, which confirm earlier research: A Harris Interactive poll released in March scored Amazon with the best reputation among large U.S. corporations.

In the Harris poll, Walmart ranked 40th out of 60 total companies, toward the back of the pack with oil drillers and wireless carriers. YouGov only ranked the top 25 U.S. companies, and Walmart did not make that list. YouGov also broke down the five highest-rated discount retailers: Amazon topped that list, too, while Walmart did not appear.

In fact, many people despise Walmart, and have for years, as a torrent of bad press has weighed on its public image. Walmart's bad rep began when it systematically squashed family-owned shops during its rapid national expansion in the ‘80s and ‘90s. Since then, Walmart has endured a wave of lawsuits from workers accusing the retailer of gender discrimination, poor health care and wage theft.

Amazon, on the other hand, is loved for the breadth of its inventory and the ease of using its website. People love its convenience.

And while Walmart crushed its smaller competition, Amazon chief Jeff Bezos can be just as ruthless against upstart online stores. According to the new book "The Everything Store" by Bloomberg Businessweek reporter Brad Stone, Bezos tried to buy Diapers.com in 2009. When rebuffed, Amazon warned the co-founders that it would get into the diaper business. Soon after, Amazon undercut Diapers.com's prices. When Walmart later made an offer to buy the site, Amazon reps warned the startup that Bezos “was such a furious competitor that he would drive diaper prices to zero if they sold to Bentonville.”

Diapers.com sold to Amazon at the end of 2010.

When reached for comment regarding the survey results, a Walmart spokesperson said that "there are many different studies that measure brands," pointing out one from last year that concluded that Walmart was the most valuable retail brand in the U.S. But that study, from the New York-based consulting firm Interbrand, is based primarily on the company's financial data rather than customer surveys.

"We offer great, full-time jobs for our employees," Amazon spokesperson Kelly Cheeseman told The Huffington Post. "We are committed to providing not just competitive wages and comprehensive benefits, but also a network of support to ensure our employees succeed." She said that warehouse workers employed by Amazon receive money toward college education and above-average pay and benefits for the retail sector. The shipping centers also employ seasonal workers from outside agencies who receive healthcare, but not Amazon's full set of benefits.

Despite the Walmart parallels, how has Amazon kept itself in the good grace of the American public?

For one, it dodged blowback from the National Security Agency spying scandal that engulfed major tech companies. Unlike Google, Microsoft, Facebook or Apple, Amazon was not implicated as cooperating with the NSA. Every other big Silicon Valley firm "took a big perception nosedive," YouGov told Business Insider.

And it helps that Bezos is apparently obsessed with avoiding the PR pitfalls of running a giant company. Again according to Stone's new book, the CEO once meticulously analyzed the characteristics that made some companies, like Apple and Nike, "cool" and other companies, like Microsoft and (yes) Walmart, not cool. Listing out his findings in a spreadsheet, he concluded that "[d]efeating tiny guys is not cool."

Amazon's warehouse horror scenes, which have started trickling out recently in local media reports, lawsuits and first-person accounts at Gawker, haven't yet taken root in the broader U.S. consciousness.

"The general press that impacts McDonald's and Walmart completely overshadows whatever press Amazon has received regarding its warehouses," Drew Kerr, a spokesperson for YouGov BrandIndex, explained. "Amazon has not had an employee newsletter which has made the same mistakes the McDonald's one did, which made it a constant source of embarrassment. Walmart is the constant subject of class action lawsuits."

But more fundamental to Amazon's business model, its low-paid workers toil anonymously in massive warehouses (or as customer-service personnel or in Amazon's "Mechanic Turk" program, in which freelancers perform menial tasks online for pennies). Meanwhile, Walmart greeters wave to you as you enter the store. Shoppers are reminded of the human toll of “Always Low Prices” whenever they visit a Walmart. But it’s harder to put a face to the “Add to Cart” button.