Walter Sparrow is an animal control officer married to Agatha; they have a son, Robin. At a bookstore, Agatha begins looking at a book titled The Number 23 written by Topsy Kretts. She later gives Walter the book as a birthday present. Walter starts reading the book, noticing odd similarities between himself and the main character, a detective who refers to himself as "Fingerling". Mirroring the detective, Walter becomes obsessed with the 23 enigma, the idea that all incidents and events are directly connected to the number 23, or to some number connected to 23. When he tries to warn Agatha about the number, she tells him he is crazy.
Walter's obsession leads him to believe that the book has secret insights into his own life. When he reads that Fingerling murders his girlfriend, Walter begins having dreams about murdering Agatha. Agatha refers him to her friend, Isaac French, who suggests he find the book's author if he wants answers. Walter's search leads him to discover the murder of Laura Tollins. Now believing the book to be a veiled confession, Walter searches for her killer.
Evidence found at a psychiatric hospital reveals Walter is Topsy Kretts, having written the book as a way to rid himself of the guilt he felt over murdering Tollins. He was never suspected of the crime, and a man named Kyle Flinch was convicted and imprisoned instead. He had dated Tollins 13 years earlier, but she left him for Flinch. Walter stabbed her to death in a jealous rage and left the scene of the crime moments before Flinch arrived and touched the knife, implicating himself in the murder. Wracked with guilt, Walter decided to kill himself and began writing a suicide note but found that he could not stop writing; the note became the book. He survived his suicide attempt but the resulting head trauma left him with amnesia.
Fearing he will hurt his family, he leaves home and moves to the same hotel in which he had attempted suicide. Agatha finds Walter at the hotel and assures him that he is no longer the person he was when he wrote the book. He insists that he is a killer and tells Agatha to leave before he kills her, too. He leaves the hotel and runs into the street, where he nearly allows himself to be run over by a bus. Walter steps out of the way at the last minute when he realizes his son is watching. He turns himself in to the police and awaits sentencing, having been told that the judge will likely go easy on him. A funeral procession takes place in front of Tollins' grave, where it is implied her body has finally been laid to rest, as Flinch observes, a free man.Jim Carrey as Walter Paul Sparrow / Detective Fingerling
Paul Butcher as Young Walter / Fingerling
Virginia Madsen as Agatha Pink-Sparrow / Fabrizia
Logan Lerman as Robin Sparrow
Danny Huston as Isaac French / Dr. Miles Phoenix
Rhona Mitra as Laura Tollins
Bud Cort (uncredited) as Dr. Leary
Chris Lajoie as Benton
Mark Pellegrino as Kyle Flinch
Lynn Collins as Isobel Lydia Hunt ("The Suicide Blonde") / Mrs. Dobkins / Young Fingerling's mother
Michelle Arthur as Sybil
Ed Lauter as Father Sebastian
Corey Stoll as Sergeant Burns
The film has an approval rating of 8% on Rotten Tomatoes based on 189 reviews; the average rating is 3.5. The site's consensus reads: "Jim Carrey has been sharp in a number of non-comedic roles, but this lurid, overheated, and self-serious potboiler is not one of them. The Number 23 is clumsy, unengaging, and mostly confusing." Of the few critics who liked the film, Richard Roeper and critic George Pennachio of KABC-TV in Los Angeles stand out, as they gave the film a "2 thumbs up" rating on the television show Ebert & Roeper (Pennachio was standing in for Roger Ebert due to Ebert's illness).
However, Michael Phillips, filling in for Ebert on the Worst of 2007 show (aired January 12, 2008) put The Number 23 at No. 7 in his list of the worst (Roeper did not include it in his list). Peter Travers of Rolling Stone declared the film the year's worst star vehicle on his list of the Worst Movies of 2007, while Colm Andrew of the Manx Independent said the film "delivers a rambling, confusing narrative with only a few stylistic elements thrown in".
The film was nominated for two Teens Choice Awards. For his performance, Carrey was nominated for the Golden Raspberry Award for Worst Actor at the 2008 Golden Raspberry Awards, but he lost the "award" to Eddie Murphy for Norbit.
On its opening weekend, The Number 23 took in $14,602,867, coming in behind Ghost Rider's second weekend. After five weeks of release, the film grossed $35,193,167 at the domestic box office and $42,373,648 overseas, for a worldwide total of $77,566,815.
The film was released on Region 1 DVD on July 24, 2007; the release contains both the theatrical version and an extended version, which runs an additional four minutes. Special features include deleted scenes, such as a much more abstract alternate opening and an alternate ending that gives a few more details about Walter's prison sentence and hints at the possibility that the son could be subject to the same obsessions as his father. The disc also includes interviews with mathematicians, psychologists, and numerologists. The DVD shows the film over a set of 23 chapters. As of August 24, 2007, The Number 23 has generated $27.7 million from DVD rental grosses.