The seven men and five women were unable to reach a unanimous decision after some 53 hours of deliberations in Norristown, Pennsylvania.
Mr Cosby, 79, is accused of drugging and sexually assaulting Andrea Constand in 2004. His lawyers had argued the sex was consensual.
The US comedian could now face new proceedings.
For now, he walks away from court a free man, but the prosecution has already said they are pursuing a fresh trial.
Dozens of women say he assaulted them, but statutes of limitation rules mean he was allowed to be tried for Ms Constand’s allegation only.
The veteran entertainer could have faced up to a decade in prison if found guilty of three counts of aggravated indecent assault.
Announcing the decision, the Pennsylvania judge reminded Mr Cosby that he remains charged and on bail, despite the mistrial.
The BBC’s Aleem Maqbool, inside the courthouse, said Mr Cosby was expressionless when the decision was announced.
The jury had been instructed by the judge to work into the weekend to reach a verdict, after they first revealed that they were deadlocked on the case on Thursday.