The novel opens with Josef K.'s sudden arrest in his room at his lodging house on the morning of his birthday. Two guards inform him that he is under arrest, but they don't tell him on what charges, nor do they know what the charges are. K. is then taken next door to the room of another tenant, Fraülein Bürstner, who happens to be absent at the time. There, he is subjected to an equally puzzling and brief interrogation by the inspector. The inspector informs K. that he is under arrest, but is free to go to work at his bank and otherwise live life as usual.
After work, K. returns back to his lodgings. He apologizes to his landlady for the inconvenience of his arrest that morning, but his landlady doesn't seem to mind. He then waits for Fraülein Bürstner in order to apologize for the disruption to her room that morning. Fraülein Bürstner is at first startled by K.'s explanation, but then permits him to dramatize the morning's events for her in her room. K.'s theatrics awaken the landlady's nephew who is sleeping in the living room. Fraülein Bürstner begs K. to leave, but, before he does, he embraces Fraülein Bürstner.
K. is told that an inquiry into his arrest will be held the following Sunday. When he arrives at the court's address, he is puzzled by the fact that the court seems to be located in an apartment building in an impoverished neighborhood. Since he wasn't given a precise address, K. wanders through the apartment buildings until he comes upon a washerwoman, who lets him into the court, which is convened in a large, cramped hall.
After introducing himself to the examining magistrate, K. protests his treatment at his arrest, and denounces the court and its officials for corruption. But, as he finishes his speech, K. notices that the court is filled with court officials. The examining magistrate tells K. that he has seriously damaged his own case by his behavior, but K. refuses to participate at all in the proceedings and leaves the courtroom.
Despite the lack of summons, K. returns to the court the following week. There, he finds only the washerwoman, who informs him that the court is not in session. The washerwoman, who turns out to be the court usher's wife, promptly seduces K., and lets him explore the courtroom, where he discovers to his dismay that the examining magistrate's notebooks are actually pornographic novels. A law student sweeps in and carries the court usher's wife away, presumably to sleep with a judge. The court usher comes by and offers to take K. on a tour of the court offices. In the dilapidated offices of the court, K. meets other defendants, whose physical condition reveals the wear and tear of undergoing a trial. All of a sudden, K. feels faint in the office's muggy atmosphere, and has to be escorted out of the court offices, where he is instantly revived by the fresh air outside.
Back at work, K. opens the door of a rubbish closet to discover the two guards who arrested him earlier being flogged. Later, K.'s uncle comes by to visit him and berates him for not pursuing his case more rigorously. K.'s uncle takes K. to visit an old friend, a defense lawyer named Huld. When they arrive, Huld happens to be chatting with the Chief Clerk of the court. As the uncle, Huld, and the Chief Clerk discuss K.'s case, K. is distracted by Huld's nurse Leni, who shows him into Huld's office and seduces him. After making love to Leni, K. meets up with his uncle outside Huld's apartment, where the uncle rails against K. again for destroying every chance of success in his case.
As the trial wears on, K. grows increasingly distracted and is unable to focus at work. He is dissatisfied with Huld, who doesn't seem to be making any progress in his case. At the bank, one of his clients, a manufacturer, offers him a letter of introduction to Titorelli, the court painter. K. visits Titorelli at his studio, where he views Titorelli's portraits of judges. Titorelli explains to K. that acquittal is unheard of, and K.'s only option is to endlessly defer his final judgment. After pushing K. to buy some of his landscape paintings, Titorelli shows K. the exit, which, to K.'s surprise, opens out onto the court offices.
K. finally decides that he must dismiss Huld and take trial matters into his own hands. When he arrives at Huld's, he meets another client, Block the merchant. Block has put everything he's had, including his business, into his defense. K. then barges into Huld's bedroom and informs Huld that he wants to dismiss Huld. Huld asks K. to reconsider, and calls Block into the room. Huld's humiliation of Block fails to impress K., who leaves as Block grovels at Huld's bed.
Some time later, K. is asked by his bank to take an Italian client on a tour of the local cathedral. When K. arrives at the cathedral, the Italian client fails to show up. After gazing at some of the cathedral's art, K. is about to leave when a priest calls out his name. The priest happens to be the prison chaplain, and chastises K. for his indifference to his case. The chaplain then tells K. a parable about a man from the country who seeks access to the Law, but is prevented from doing so by a gatekeeper. After discussing the numerous possible interpretations of this parable, K. asks the chaplain for help with his case, but the chaplain refuses.
Finally, it is K.'s birthday again. He is dressed to go out that evening, but he is surprised by two formally dressed men. The two men guide him to a quarry outside of town, where one of them holds him at his neck and the other stabs him twice in the heart.