The biggest news outlets published more negative stories about Hillary Clinton than any other presidential candidate — including Donald Trump — from January 2015 to April 2016, according to an analysis of hundreds of thousands of online stories.

Clinton has not only been hammered by the most negative coverage but the media also wrote the smallest proportion of positive stories about her, reports Crimson Hexagon, a social media software analytics company based out of Boston.

Of course, these numbers are just one way of looking at media bias in the presidential campaign. For instance, while the press has hit Clinton more frequently, Crimson Hexagon also found that it's paid much more attention to her than to Bernie Sanders. And, by design, this kind of analysis may overlook other ways the press can hurt a candidate — like Sanders — by downplaying or dismissing his or her chances.

Still, Sanders's supporters have widely accused the media of being in the tank for Clinton. And these numbers suggest that perception may not square with reality.

How was this analysis was conducted?

To figure out which news outlets to include in its analysis, Crimson Hexagon used software that measures the number of retweets and mentions on Twitter from publications and their most prolific reporters. They figured out which sites had generated the most "conversation" around each of the candidates, and then filtered out aggregators and other internet bots that weren't writing original stories.

Their final list — which includes the Washington Post, Politico, Fox News, the Huffington Post, and CNN — looks like a fairly conventional ranking of the biggest media players.

Crimson Hexagon then took more than 170,000 posts by these outlets — stories published from January 1, 2015, until April — and ran them through their "auto-sentiment" tool. The software scans tens of thousands of stories within minutes for positive or negative language, sorts them into separate buckets, and tallies up the results.

For example, the software would take at a sentence that said "Trump made a stronger argument" and mark it as a "positive sentiment." Once it looks through the entire story, the software then categorizes the article as positive, negative, or neutral.

"We comb the content and see whether it's positive or negative," says Molly Moriarty, content marketing manager at Crimson Hexagon. "As you'll see, a lot of the conversation about the candidates is overtly negative."

Here's an example of how Crimson Hexagon "coded" three stories about Hillary Clinton, for instance:

Crimson Hexagon created this software several years ago and it's mostly used to do market research for companies. To create it, staffers manually entered hundreds of thousands of stories and individually coded them as either "positive," "neutral," or "negative."

From this initial database, the company's software created patterns that now lets it automatically sort the posts by the "sentiment" of its content.

"Once you have done the human work to recognize and categorize all the posts, an algorithm can take over and — through pattern recognition — analyze an incredibly large dataset," says Benjamin Cockerell, director of global marketing at Crimson Hexagon.

Once all the stories are sorted into one of the three bins, it's just simple arithmetic to figure out which candidate got the most negative coverage and which got the most positive.

Whether supporters of Bernie Sanders, Ted Cruz, and Donald Trump will really believe their candidates have gotten more positive coverage than Clinton, however, is another question altogether.

How Clinton's negative coverage may also reflect the media's positive view of her chances

Sanders's supporters have alleged that the press has unfairly treated the Vermont senator's candidacy, even picketing CNN to protest a "media blackout" of their candidate.

At first glance, the Crimson Hexagon data suggests that they're wrong to complain: After all, it shows that the media has battered Clinton more than any other candidate, perhaps because of the ongoing controversy over her emails.

But the greater scrutiny probably also reflects the fact that the media regards her as a more serious frontrunner than Sanders. And that may really have hurt Sanders's chances as much as — or more than — negative stories.

"If you are portrayed as not having much of a chance to win, studies show voters tend to pick up on that. They echo the opinions of journalists that certain candidates are not worth following," says Bob Lichter, a George Mason communications professor and director of the Center for Media and Public Affairs.

Of course, this cuts both ways. Sanders's fans may have a point when they complain that the press hasn't taken their candidate seriously. But if the media had treated Sanders as a likely winner, it would have almost certainly attacked him more frequently too.

"One of the goals of American journalists is to get out all the information on the person most likely to be president," Lichter says. "As soon as a person moves ahead in the polls, the coverage turns more negative."

Correction: A previous version of this story incorrectly said Crimson Hexagon's tool was created with "thousands" of manually-coded stories. In fact, the number is in the hundreds of thousands.

Watch: Hillary Clinton slams debate moderators for failing to ask a single abortion question