The narrator Red explains that he’s central to Shawshank prison culture because he knows how to smuggle contraband. In 1938, at age 20, Red was incarcerated for cutting the brakes on his wife’s car, killing her and two people hitching a ride. He claims to talk about himself only as background to his real story—the story of Andy Dufresne.
In 1948, 30-year-old banker Andy Dufresne is wrongly convicted of murdering his wife Linda and her lover Glenn Quentin and is sent to Shawshank prison. Soon after entering prison, Andy is targeted by a gang of rapists. When Andy approaches Red in the exercise yard and asks Red to get him a rock-hammer, Red worries Andy may use it as a weapon. Andy explains he wants to use it for his hobby, collecting rocks. Though rapists repeatedly target Andy, and though he repeatedly enters solitary confinement as punishment for fighting back, he never uses the rock-hammer as a weapon, earning Red’s goodwill. In 1949, Andy—acting secretive and embarrassed—asks Red for a Rita Hayworth pin-up poster. Red, amused, gets it for him. Andy continues to buy pin-up posters from Red throughout his incarceration.
In 1950, Andy, Red, and some other prisoners are working outside, tarring a roof, when they overhear a guard named Byron Hadley complaining about having to pay taxes on an inheritance. Andy asks Hadley whether Hadley trusts his wife. When Hadley and another guard threaten to throw Andy off the roof for impertinence, Andy explains: an IRS loophole allows a person to make a one-time, tax-free gift to their spouse. Hadley can give the inheritance to his wife and avoid the taxes. Andy offers to do the gift paperwork for Hadley if Hadley gets beers for the prisoners tarring the roof. Hadley agrees, making Andy a legend among other prisoners. After this, Andy begins helping the prison staff to do their taxes and to launder money from their illicit activities (drug dealing, embezzlement, racketeering, etc.). In return, the guards keep him safe from rapists and the administration makes sure he never has to have a cellmate.
In 1962, Tommy Williams enters Shawshank prison. In 1963, after learning why Andy is in prison, Tommy tells Andy that during a previous incarceration at another prison, Tommy had a cellmate named Elwood Blatch, in for burglary, who bragged about having gotten away with murder. Blatch killed a golf instructor named Glenn Quentin and Glenn’s girlfriend during a burglary, but the girlfriend’s husband was convicted for it. Tommy’s description of Blatch matches Andy’s memory of an employee at the country club where his wife met Glenn. Andy goes to the current warden, Samuel Norton, for whom he launders money, and tells him the story. Norton—perhaps afraid Andy will inform on him if Andy is freed—claims not to believe the story and transfers Tommy to a lower-security prison as a bribe to shut him up.
From 1963 to 1967, Andy suffers depressed moods silently. Then, in 1967, his mood improves. One day, in the exercise yard, Andy tells Red that once he’s left prison, he plans to open a hotel in Zihuatanejo, Mexico. When Red asks how Andy will buy a hotel, Andy explains that after he was accused of murder, his war buddy Jim helped him transfer his wealth to a fake identity, Peter Stevens. Jim has since died, so Andy can’t access the money in prison—but Jim left the key to Peter Stevens’s safe deposit box underneath a paperweight in a hayfield in a town near Shawshank. If Andy can access the key, he’ll have a new identity and a small fortune. Then Andy says he could use a man like Red to help with the hotel business. Red demurs, claiming he’s been in prison too long to survive in the free world. Andy insists Red should think about it.
One morning in 1975, guards discover Andy’s missing. Enraged, Norton searches Andy’s cell, tears down his pin-up poster, and finds a hidden hole in Andy’s cell wall. A guard, searching the hole, discovers that Andy tunneled to a sewer pipe and broke a hole in it using his rock-hammer, which he subsequently abandoned. Andy presumably then escaped the prison through the sewer system. Later in 1975, Red receives a blank postcard from a town on the U.S.-Mexico border, which he believes is a coded message from Andy communicating that Andy is free and chasing his dream. Red reveals he’s been writing Andy’s story since he received the postcard and now, in 1976, has finished.
In 1977, Red is paroled and resumes his story. After his release, he finds the free world so disorienting that he considers committing another crime to return to prison; instead, to distract himself, he goes searching for the paperweight in the hayfield that Andy told him about. When he finds it, he discovers an envelope containing $1,000 and a letter from Andy suggesting that Red join him in Mexico. Red, scared but full of hope, decides to break parole and join Andy in Mexico.