Bill Cosby has hired a battalion of private investigators to dig up dirt on his many accusers, The Post has learned.

The comedian, fighting an onslaught of accusations that he sexually assaulted more than two dozen women over many years, is paying six-figure fees to private investigators for information that might discredit his alleged victims.

Multiple sources confirmed that Cosby, through his Hollywood attorney Martin Singer, is implementing a scorched-earth strategy in which anything negative in his accusers’ pasts is fair game.

At least one Glendale, Calif.-based firm with a half-dozen former LAPD detectives on staff is muckraking for Cosby, a source said.

“If you’re going to say to the world that I did this to you, then the world needs to know, ‘What kind of person are you? Who is this person that’s saying it?’ ” Cosby told his legal and public-relations team at a recent meeting, according to an insider who was present.

Beverly JohnsonGetty Images

“You can’t say that I put something in your coffee, threw you in a cab and then you go on and live a high-profile life, a famous life and you never complain,” Cosby said, referring to supermodel Beverly Johnson, who claimed “America’s Dad” spiked her cappuccino during a visit to his home in the 1980s, the source said. “You mean you never reported it to the police? You never tell anyone?”

The source continued: “The strategy isn’t new and it’s quite simple: You say I’m a bad guy, well, let’s see what gives you the right to throw a stone at my house when your home is also made of glass.”

Another source, who has worked with Cosby for at least a decade, confirmed the alleged legal strategy.

“It’s sort of worked to some degree already,” that source said. “They were able to find out information about Beverly Johnson’s boyfriend who said she only had good things to say about Cosby. We found out that Beverly never told her live-in lover of several years what she’s now telling the media and we found that to be strange.”

“The strategy isn’t new and it’s quite simple: You say I’m a bad guy, well, let’s see what gives you the right to throw a stone at my house when your home is also made of glass.”

- Source

The insider said they’ve also been able to dig up information on another accuser — Katherine McKee, an ex-girlfriend of the late Sammy Davis Jr. who said Cosby raped her in the 1970s.

The comedian’s investigators were immediately able to dig up internet posts in which McKee allegedly praised Cosby’s stand-up act and wrote glowingly of him.

They also discovered a published interview in which she said she is “used to lying.”

Singer refused to address the hiring of private detectives but said Cosby has not been able to rely on the press to be fair.