On his thirtieth birthday, the chief financial officer of a bank, Josef K., is unexpectedly arrested by two unidentified agents from an unspecified agency for an unspecified crime. The agents' boss later arrives and holds a mini-tribunal in the room of K.'s neighbor, Fräulein Bürstner. K. is not taken away, however, but left "free" and told to await instructions from the Committee of Affairs. He goes to work, and that night apologizes to Fräulein Bürstner for the intrusion into her room. At the end of the conversation he suddenly kisses her.
K. receives a phone call summoning him to court, and the coming Sunday is arranged as the date. No time is set, but the address is given to him. The address turns out to be a huge tenement building. K. has to explore to find the court, which turns out to be in the attic. The room is airless, shabby, and crowded, and although he has no idea what he is charged with, or what authorizes the process, K. makes a long speech denigrating the whole process, including the agents who arrested him; during this speech an attendant's wife and a man engage in sexual activities. K. then returns home.
K. later goes to visit the court again, although he has not been summoned, and finds that it is not in session. He instead talks with the attendant's wife, who attempts to seduce him into taking her away, and who gives him more information about the process and offers to help him. K. later goes with the attendant to a higher level of the attic where the shabby and airless offices of the court are housed.
K. returns home to find Fräulein Montag, a lodger from another room, moving in with Fräulein Bürstner. He suspects that this is to prevent him from pursuing his affair with the latter woman. Yet another lodger, Captain Lanz, appears to be in league with Montag.
Later, in a store room at his own bank, K. discovers the two agents who arrested him being whipped by a flogger for asking K. for bribes and as a result of complaints K. made at court. K. tries to argue with the flogger, saying that the men need not be whipped, but the flogger cannot be swayed. The next day he returns to the store room and is shocked to find everything as he had found it the day before, including the whipper and the two agents.
K. is visited by his uncle, who was K.'s guardian. The uncle seems distressed by K.'s predicament. At first sympathetic, he becomes concerned that K. is underestimating the seriousness of the case. The uncle introduces K. to a lawyer, who is attended by Leni, a nurse, who K.'s uncle suspects is the advocate's mistress. During the discussion it becomes clear how different this process is from regular legal proceedings: guilt is assumed, the bureaucracy running it is vast with many levels, and everything is secret, from the charge, to the rules of the court, to the authority behind the courts – even the identity of the judges at the higher levels. The attorney tells him that he can prepare a brief for K., but since the charge is unknown and the rules are unknown, it is difficult work. It also never may be read, but is still very important. The lawyer says that his most important task is to deal with powerful court officials behind the scenes. As they talk, the lawyer reveals that the Chief Clerk of the Court has been sitting hidden in the darkness of a corner. The Chief Clerk emerges to join the conversation, but K. is called away by Leni, who takes him to the next room, where she offers to help him and seduces him. They have a sexual encounter. Afterwards K. meets his uncle outside, who is angry, claiming that K.'s lack of respect has hurt K.'s case.
K. visits the lawyer several times. The lawyer tells him incessantly how dire his situation is and tells many stories of other hopeless clients and of his behind-the-scenes efforts on behalf of these clients, and brags about his many connections. The brief is never complete. K.'s work at the bank deteriorates as he is consumed with worry about his case.
K. is surprised by one of his bank clients, who tells K. that he is aware that K. is dealing with a trial. The client learned of K.'s case from Titorelli, a painter, who has dealings with the court and told the client about K.'s case. The client advises K. to go to Titorelli for advice. Titorelli lives in the attic of a tenement in a suburb on the opposite side of town from the court that K. visited. Three teenage girls taunt K. on the steps and tease him sexually. Titorelli turns out to be an official painter of portraits for the court – an inherited position – and has a deep understanding of the process. K. learns that, to Titorelli's knowledge, not a single defendant has ever been acquitted. He sets out K.'s options and offers to help K. with either. The options are: obtain a provisional verdict of innocence from the lower court, which can be overturned at any time by higher levels of the court, which would lead to re-initiation of the process; or curry favor with the lower judges to keep the process moving at a glacial pace. Titorelli has K. leave through a small back door, as the girls are blocking the door through which K. entered. To K.'s shock, the door opens into another warren of the court's offices – again shabby and airless.
K. decides to take control of matters himself and visits his lawyer with the intention of dismissing him. At the lawyer's office he meets a downtrodden individual, Block, a client who offers K. some insight from a client's perspective. Block's case has continued for five years and he has gone from being a successful businessman to being almost bankrupt and is virtually enslaved by his dependence on the lawyer and Leni, with whom he appears to be sexually involved. The lawyer mocks Block in front of K. for his dog-like subservience. This experience further poisons K.'s opinion of his lawyer. (This chapter was left unfinished by the author.)
K. is asked by the bank to show an Italian client around local places of cultural interest, but the Italian client, short of time, asks K. to take him only to the cathedral, setting a time to meet there. When the client does not show up, K. explores the cathedral, which is empty except for an old woman and a church official. K. notices a priest who seems to be preparing to give a sermon from a small second pulpit, and K. begins to leave, lest it begin and K. be compelled to stay for its entirety. Instead of giving a sermon, the priest calls out K.'s name. K. approaches the pulpit and the priest berates him for his attitude toward the trial and for seeking help, especially from women. K. asks him to come down and the two men walk inside the cathedral. The priest works for the court as a chaplain and tells K. a fable (which was published earlier as "Before the Law") that is meant to explain his situation. K. and the priest discuss the parable. The priest tells K. that the parable is an ancient text of the court, and many generations of court officials have interpreted it differently.
On the eve of K.'s thirty-first birthday, two men arrive at his apartment. He has been waiting for them, and he offers little resistance – indeed the two men take direction from K. as they walk through town. K. leads them to a quarry where the two men place K's head on a discarded block. One of the men produces a double-edged butcher knife, and as the two men pass it back and forth between them, the narrator tells us that "K. knew then precisely, that it would have been his duty to take the knife...and thrust it into himself." He does not take the knife. One of the men holds his shoulder and pulls him up and the other man stabs him in the heart and twists the knife twice. K.'s last words are: "Like a dog!"