The two things everyone knows about Ty Cobb are that he was a phenomenal baseball player and that he was the worst racist ever to play the game.

But one of these things is mostly wrong.

Cobb, the first player voted into the Baseball Hall of Fame, the holder of more than 90 records upon his retirement and still the pace-setter with a .366 lifetime batting average, could be rude, but not nearly as nasty as you think. And far from being the most notorious racist in baseball history, he was an early and vocal supporter of integrating the big leagues.

In his new biography, “Ty Cobb: A Terrible Beauty” (Simon & Schuster), Charles Leerhsen opens with a comedy routine that details some of the many myths about the Detroit Tigers superstar.

Was he a wife-beater? “He was an everything beater,” offered comic Jim Norton. “A horrible racist. A Demerol addict . . . in 1907 Cobb fought a black groundskeeper . . . and ended up choking the man’s wife when she intervened.”

“On several occasions he brutally pistol-whipped African-American men whose only offense was to share a sidewalk with him,” wrote a biographer of Hall of Famer Tris Speaker.

In Ken Burns’ “Baseball,” Cobb is called “an embarrassment to the game.” Most notoriously, we all know that Cobb stabbed a black waiter in Cleveland and was a member of the Ku Klux Klan.

Except none of these allegations is true.

The thinker

Cobb, contrary to legend, was not a Southern redneck but an upper-middle-class boy, often derided for acting aristocratic in the locker room, where he would read literary novels and biographies of Thomas Jefferson and Napoleon. Both of his parents were genteel. His father, a state senator and “something of a public intellectual,” in Leerhsen’s words, once broke up a group of men plotting a lynching and was an outspoken advocate for the public education of black Americans.

When Cobb was 18, his mother shot and killed his father, mistaking him for an intruder after he returned unexpectedly from an out-of-town trip. At trial, she was acquitted.

You might call Cobb the inventor of Moneyball — roughly, the idea that baseball is about smarts.

“He didn’t outhit the opposition and he didn’t outrun them,” said a teammate. “He out-thought them.”

In a hilariously unprofessional era when ballplayers would chase umpires they didn’t like off the field, Cobb took careful notes exploiting the weaknesses of other teams. Cobb noticed, for instance, that Walter Johnson was visibly upset whenever he hit a batter — so he stuck his skull out over the plate. Johnson, afraid of beaning Cobb, would walk him instead.

Cobb once scored the winning run by stealing third and home when the Yankees were busy arguing with an umpire. Cobb, noted baseball legend Casey Stengel, was the only player who could steal home on an infield pop-up: He’d make his break when the guy who caught the ball was lobbing the ball back to the pitcher. He noticed a tell in Cy Young’s pickoff move: The pitcher would hold his hands up close to his chin when he was going to throw to first. Cobb stole easily on him after that.

Cobb enthusiastically supported the integration of major league baseball when he was asked about Jackie Robinson in 1952. He told The Sporting News, “The negro has the right to compete in sports and who’s to say they have not?”

He called Roy Campanella a “great” player, said Willie Mays was “the only player I’d pay money to see” and after Campanella’s crippling car accident, praised Dodgers owner Walter O’Malley for holding a candlelit tribute “for this fine man.”

Even back in the 1920s, Cobb would befriend Negro League ballplayers such as Detroit Stars infielder Bobby Robinson, who said “there wasn’t a hint of prejudice in Cobb’s attitude.”

One of several blacks employed by Cobb, Alex Rivers, named his son after the ballplayer and said, “I love the man.”

The hitter

Cobb did brawl often — a pastime so common in his era that Dr. Spock actually recommended little boys enjoy at least one fight a day and the head of the American Psychological Association encouraged fights. On the Bowery in the early 1900s, “black-eye repair shops” offered makeup treatments to men bruised in barroom battle.

For his first couple of seasons on the Tigers, Cobb was subjected to sustained hazing by his teammates, several of whom despised him. In 1907, on his way to the clubhouse, Cobb shoved a black groundskeeper who, under the influence of alcohol, got in Cobb’s face and made a jokey greeting that the latter evidently found annoying.

There is no indication that race had anything to do with the encounter. A moment later, Cobb was attacked by a catcher on his own team, a much larger man who had a habit of beating up Cobb.

The catcher told sportswriters Cobb had previously assaulted the black groundskeeper and his wife, but this story is likely untrue. Cobb hotly denied the claim and no one asked the groundskeeper if it was true, nor were charges filed.

The catcher, his manager later admitted, was in the midst of a badmouthing campaign intended to get Cobb traded, so he was at best a questionable witness.

In 1908, among many other brawls Cobb participated in, he ignored an order from a black man laying asphalt in Detroit to stop walking, then after the two argued, Cobb started a vicious fistfight and was overheard to use the N-word against the road paver.

Today that behavior would certainly brand you as a racist, but racial slurs were commonplace then, even published in the papers.

Balance that ugly fight against Cobb’s behavior toward a 16-year-old black team mascot, Ulysses Harrison. Ballboys were badly treated at the time, paid pennies and sometimes unceremoniously dumped on road trips if they were thought to be bringing bad luck.

The Detroit News referred to Harrison as “a pickaninny” and “the Ethiopian.” But Cobb became the youth’s “main defender and patron” and on (segregated) sleeping trains let the kid sleep below his berth, hiding him from view with luggage so no one would detect him. He also let the kid share his room at segregated hotels.

After the baseball season, Cobb took Harrison back home to Georgia and gave him a job, and may well have gotten him a permanent job as a chauffeur to a Detroit construction tycoon.

Changing the story

The most famous story cited as evidence of Cobb’s racism actually had nothing to do with race. In 1909, Cobb got into a fight in a Cleveland hotel that, according to legend, led to the stabbing death of a black man.

That isn’t true. No one was killed. Cobb fought with the (white) security guard, whom he claimed he lightly raked across the back of the wrist with a pen knife, though the guard later said Cobb stabbed him in the shoulder and the hand. Cobb may have also struck a bellhop.

Cobb enthusiastically supported the integration of major league baseball when he was asked about Jackie Robinson in 1952.

Race had nothing to do with this incident. Neither of the other men was ever described as black in the numerous newspaper reports at the time, though at the time reporters invariably and delightedly pointed out when someone was a “negro.” Leerhsen even dug up the census report that lists the watchman’s race as white.

Charles Alexander’s 1984 Cobb biography says both the watchman and the bellboy were black, but when asked by Leerhsen where he got that information, Alexander offered no specific source, offering vaguely that it was in news reports of the time. “It isn’t,” Leerhsen declares flatly.

Cobb eventually pleaded guilty to simple assault, paying a fine of $100 and a settlement of $115 to the watchman. Sometimes Alexander’s account is distorted beyond all recognition into a story that Cobb stabbed a black waiter in Cleveland “for being uppity.” That isn’t even close to the truth.

On another occasion, Cobb climbed into the stands to argue with a black fan (what was said is not recorded) and he once, notoriously, beat up a (white) heckler (who was missing seven fingers due to lax safety standards at his employer, the New York Times).

That wasn’t as unusual as it sounds, either: Pitcher Rube Waddell also went into the stands to beat up a fan; Babe Ruth in 1922 chased a fan through the seats and, when he couldn’t find him, challenged anybody nearby to a fight; and even the sainted Christy Mathewson, in 1905, popped a lemonade boy in the mouth, splitting his lip. Later, Cobb got in a fight with a grocer over an alleged insult to his wife, but the grocer was white, too — and in his biography, Alexander again got it wrong, mistakenly reporting the man was black.

Who made the myth

Today’s Cobb hatred comes mainly from two sources: Alexander’s mistakes and Al Stump, the ghostwriter of Cobb’s autobiography, who produced a fictionalized account so full of lies that Cobb was preparing to sue to stop its publication when he died in 1961.

Stump was such a hack that he was banned from contributing to both TV Guide and the Saturday Evening Post. “One by one he alienated the kinds of magazines that had fact-checking departments,” said a writer of that era who knew him. “That’s because he produced fiction.”

Fact-checking Stump’s work, Leerhsen found it teeming with falsehoods. For instance, Stump claimed Cobb killed one of three men who tried to mug the superstar in a car in 1912, citing “an unidentified body” found in an alley shortly after the encounter. That body simply didn’t exist, as a report in the National Baseball Research Journal later discovered.

Stump was the source of the 1994 Tommy Lee Jones movie “Cobb,” whose director, Ron Shelton, told Leerhsen, “It’s well known that Cobb may have killed as many as three people.” Asked where he got this information, Shelton said only, “It’s well known.” Shelton admitted to Leerhsen that he and Stump simply fabricated a scene in which the elderly Cobb tries to rape a girl in Las Vegas but fails because of impotence.

The real Cobb, in later years, funded a hospital and started a college-education fund for kids. In response to fan mail, he’d send letters as long as five pages.

One kid who wrote him, Koosma Tarasoff, Cobb mentored to the point of getting him a tryout with the Pittsburgh Pirates. “He was a good human being,” Tarasoff said in 2004. Another young ballplayer Cobb mentored, and whose first contract Cobb helped negotiate, had better luck. His name was Joe DiMaggio.

Our punching bag

Why the determination to brand Cobb as the worst racist ever? Stump apparently believed a more sensational book would lead to more sales. But a large part of the story, Leerhsen notes, is simply that the accurate perception of Cobb as a hothead simply got mixed up with the fact that he was born in Georgia in 1886. Bad temper, Southerner: Must have been a racist.

That’s both too broadly damning — not only were Southerners not necessarily racist, Cobb’s own father fought for better treatment of blacks — and it lets us off the hook too easily.

Detecting sin in someone else is a way of announcing to the world, and to yourself, your own virtue.