The story takes place during three years (1933–35) of the Great Depression in the fictional "tired old town" of Maycomb, Alabama, the seat of Maycomb County. It focuses on six-year-old Jean Louise Finch (Scout), who lives with her older brother, Jem, and their widowed father, Atticus, a middle-aged lawyer. Jem and Scout befriend a boy named Dill, who visits Maycomb to stay with his aunt each summer. The three children are terrified of, and fascinated by, their neighbor, the reclusive Arthur "Boo" Radley. The adults of Maycomb are hesitant to talk about Boo, and, for many years few have seen him. The children feed one another's imagination with rumors about his appearance and reasons for remaining hidden, and they fantasize about how to get him out of his house. After two summers of friendship with Dill, Scout and Jem find that someone leaves them small gifts in a tree outside the Radley place. Several times the mysterious Boo makes gestures of affection to the children, but, to their disappointment, he never appears in person.
Judge Taylor appoints Atticus to defend Tom Robinson, a black man who has been accused of raping a young white woman, Mayella Ewell. Although many of Maycomb's citizens disapprove, Atticus agrees to defend Tom to the best of his ability. Other children taunt Jem and Scout for Atticus's actions, calling him a "nigger-lover". Scout is tempted to stand up for her father's honor by fighting, even though he has told her not to. Atticus faces a group of men intent on lynching Tom. This danger is averted when Scout, Jem, and Dill shame the mob into dispersing by forcing them to view the situation from Atticus' and Tom's points of view.
Atticus does not want Jem and Scout to be present at Tom Robinson's trial. No seat is available on the main floor, so by invitation of Rev. Sykes, Jem, Scout, and Dill watch from the colored balcony. Atticus establishes that the accusers—Mayella and her father, Bob Ewell, the town drunk—are lying. It also becomes clear that the friendless Mayella made sexual advances toward Tom, and that her father caught her and beat her. Despite significant evidence of Tom's innocence, the jury convicts him. Jem's faith in justice becomes badly shaken, as is Atticus', when the hapless Tom is shot and killed while trying to escape from prison.
Despite Tom's conviction, Bob Ewell is humiliated by the events of the trial, Atticus explaining that he "destroyed [Ewell's] last shred of credibility at that trial." Ewell vows revenge, spitting in Atticus' face, trying to break into the judge's house, and menacing Tom Robinson's widow. Finally, he attacks the defenseless Jem and Scout while they walk home on a dark night after the school Halloween pageant. One of Jem's arms is broken in the struggle, but amid the confusion someone comes to the children's rescue. The mysterious man carries Jem home, where Scout realizes that he is Boo Radley.
Sheriff Tate arrives and discovers that Bob Ewell has died during the fight. The sheriff argues with Atticus about the prudence and ethics of charging Jem (whom Atticus believes to be responsible) or Boo (whom Tate believes to be responsible). Atticus eventually accepts the sheriff's story that Ewell simply fell on his own knife. Boo asks Scout to walk him home, and after she says goodbye to him at his front door he disappears again. While standing on the Radley porch, Scout imagines life from Boo's perspective, and regrets that they had never repaid him for the gifts he had given them.