D-503, an engineer in a distant future, begins a journal on the behest of OneState, a dictatorial regime. The journal is designed to function as propaganda for its expansion to other planets. This conquest is accomplished with the INTEGRAL, a gigantic spaceship. In OneState, life is heavily regulated and citizens lack basic rights and freedoms; even sex is scheduled and controlled. All buildings and furnishings are made of glass to facilitate surveillance. D-503 struggles to describe his life to soon-to-be conquered aliens, who lack a lingua franca.
D-503 is enjoying a mandatory walk around the city with his usual sexual companion, O-90, when he meets I-330, a woman whom he finds rather irritating. She remarks they will meet again soon at Auditorium 112. He notices a strangely familiar man, S-4711, by her side, who he later realizes is a member of the Guardians, the state police. D-503 is unnerved when he is assigned to Auditorium 112, where he listens to I-330 play beautiful music on the piano. The demonstration is meant to ridicule ancient music, but it inspires strange emotions in D-503.
Later, I-330 calls D-503 and asks him to accompany her to the Ancient House, an old building and museum. Disturbed by the chaotic artifacts, D-503 notices I-330 has an affinity for the colorful clothes and furniture of the past. I-330 asks him to skip work and stay with her, but D-503 refuses. However, he doesn’t report I-330, claiming he does not have the time to do so; in reality, when speaking with Guardian S-4711 in his office, D-503 cannot bring himself to turn in I-330. After work he intends to visit the Bureau of Guardians, but instead visits the Medical Bureau after O-90 suggests he may be sick.
D-503 reveals that, as a child, the irrational concept of √-1 terrified him. He meets with O-90 and his friend R-13; the three travel to R-13’s apartment. R-13 reveals that another poet was executed that morning for proclaiming himself to be above the law. D-503 leaves so that R-13 and O-90 can keep their appointment for sex. Later, D-503 attends the execution of a dissident, at which R-13 reads several verses. The rebel is executed by a machine that disintegrates him into a puddle of water.
I-330 submits a sexual request for D-503, forcing him to meet her at her apartment, where she smokes and drinks. D-503 drinks some of the illegal alcohol and hallucinates about his animalistic side. When I-330 mentions another lover, D-503 jealously bites her. Later, D-503 watches himself in the mirror and does not recognize the stranger reflected there. R-13 visits him, and they discuss how OneState is helping return humans to the Garden of Eden. Yet, when R-13 jokingly refers to I-330’s lovers, D-503 nearly attacks him.
D-503 writes that he is happy that S-4711 is constantly watching him, as it helps him to be a better citizen. The next morning a fog covers the entire city, turning all the glass walls opaque. D-503 meets I-330, and they visit a doctor who writes them fake sick notices for work. They then go to the Ancient House, where they have spontaneous sex. Afterwards, D-503 finds that I-330 has disappeared from the enclosed room.
The next day D-503 attempts to have scheduled sex with O-90, but finds he cannot perform. O-90 is devastated. The next day D-503 returns to work, where a coworker informs him that a rebel was found spying on the premises and was taken to Operations. D-503 writes approvingly of Operations, the bureau that tortures dissidents.
I-330 hasn’t contacted D-503 since the night she disappeared. Depressed, D-503 searches for her in her apartment building. When he finds her, she refuses to speak with him. S-4711 materializes to escort him to a doctor that diagnoses D-503 with 'having a soul', a serious illness in OneState. The doctor, who wrote him a sick pass earlier, recommends D-503 take more walks. Following the doctor’s orders, D-503 meanders along the glass wall separating the city from the wilderness. On the other side he sees a beast, and wonders whether the animal is happier than he is.
At the Ancient House, D-503 kisses the old caretaker in a moment of joy before looking for I-330. When he sees S-4711, D-503 flees into a wardrobe and finds himself in a series of secret tunnels. He comes to a door, where the surprised doctor answers his knock. I-330 arrives and escorts him back to the world above.
After another walk, D-503 arrives home to find a letter waiting for him. The woman at the apartment desk, U, sympathizes with him and offers him companionship. The letter is from O-90 asking if she should withdraw her sexual registration for him. She also writes that she loves him. D-503 expects a visit from I-330, but a man arrives in her stead with a letter, asking D-503 to lower his blinds and punch her sex ticket, as if she were there. D-503 is angry and hurt.
Later, during a mandatory lecture, a child almost falls off the stage, and O-90 rushes up to save him. When he walks into this apartment, D-503 finds O there. She begs him to have a child with her, claiming not to care whether or not she is executed. D-503 agrees, lowers the blinds, and punches I-330’s ticket, in accordance with the letter’s instructions.
D-503 returns to the Ancient House, but finds only S-4711 and several guardian ships. Back at his apartment he talks about the upcoming Day of Unanimity, an election day, with U. On another walk, D-503 witnesses a woman stand up for a boy whom the Guardians are torturing. Thinking the woman is I-330, he attempts to rescue her, realizing too late that she is a stranger. He is arrested, but S-4711 commands the other Guardians to release him.
I-330 visits D-503, but refuses to tell him about her plans for the day of Unanimity. She does, however, ask about the progress of the INTEGRAL, the spaceship D-503 is helping to build. Afterwards, I-330 calls D-503, but again refuses to explain her intentions for the next day. At the celebrations, I-330, R-13, and other rebels vote against the reelection of the Benefactor, OneState’s dictator, for the first time in national history. The next day, posters announcing the Mephi, the rebel group responsible, appear all over the city.
I-330 takes D-503 beyond the glass walls circling the city. There D-503 finds a gathering of wild tribesmen and citizens of OneState. I-330 delivers a speech, referring to D-503 as the Builder of the INTEGRAL. D-503 yells to the crowd that they must all go mad. He briefly sees a glimpse of S-4711, but is convinced he must be mistaken.
U jealously tries to prevent I-330 from seeing D-503 at his apartment, which enrages D-503. I-330 reports that the auditoriums are all being filled with medical equipment. A comrade warns that S-4711 and the Guardians are coming, so I-330 leaves. S-4711 finds D-503 writing patriotic treatises at his desk. U is with the Guardians -- it was U who called them.
As he is walking towards the Ancient House, D-503 notices O-90 behind him. O describes how happy she is to feel a child inside her. D-503 pities her, knowing that the punishment for an unplanned pregnancy is death. He suggests that I-330 could smuggle O-90 to safety, but O refuses to meet with the woman who stole D-503 from her.
At the Ancient House, I-330 explains to D-503 that they must steal the INTEGRAL the day after tomorrow, during its first test flight. Disturbed, D-503 says that OneState was the result of the final revolution. I-330 invokes infinity: she posits that, just as there is no final number, there is no final revolution.
In the morning, the State Gazette announces that scientists have perfected a surgery to extract the human imagination. D-503 greets the declaration with relief. At work, a builder informs him that the test flight has been postponed one day, given the large amount of surgeries that will be happening. Afterwards, U visits D-503 at his apartment, saying that she took her class of children to have the operation performed.
At work, D-503 ensures the INTEGRAL is stocked with over a week’s worth of fuel. As he walks home, the government attempts to forcibly round up citizens for the operation. D-503 narrowly escapes and finds O-90 in the crowd, who agrees to meet with I-330. In the morning, the State Gazette announces that operation to remove imagination is now mandatory for all citizens.
D-503 and the rebels attempt to steal the INTEGRAL but fail, as the Guardians had been warned of their efforts in advance. D-503 realizes U must have seen his papers and reported him. Back in his bedroom, D-503 thinks of ways to kill U. He wanders the city looking for her, and finds I-330 giving a speech in a train station. D-503 finds U back at his apartment, but is unable to kill her after U wrongly assumes he wants to have sex with her. As D-503 is laughing, he receives a call from the Benefactor, summoning him. U reveals that she did not report I-330 by name: she was afraid that D-503 wouldn’t love her if she were to do so.
The Benefactor justifies his regime by comparing himself to a cruel, loving, Christian God. He argues that OneState is paradise, a place in which residents have no desires and remain innocent. The Benefactor tells D-503 that I-330 has only used him for the sake of the revolution. D-503 travels to I-330’s apartment and finds sex-tickets with his name, evidence that she has been using him as an alibi. I-330 visits D-503 to ask about his encounter with the Benefactor. D-503 tells her everything, despite feeling used.
Furious, D-503 goes to report I-330 to the Bureau of the Guardians. He speaks to S-4711, revealing all he knows about the rebels, only to realize half-way through that S-4711 himself is a rebel. D-503 flees to the subway, where he meets a deranged neighbor who claims he has disproven the concept of infinity.
D-503 writes a final entry in very precise and factual language. He has undergone the operation. He explains that he and his neighbor were arrested for failing to report for their surgeries. After the procedure, D-503 reports all he knows to the Benefactor. Later he is summoned to watch I-330 tortured with the gas bell; he is unmoved by this. Tomorrow, I-330 and the other rebels will be executed. The Western side of the city is in chaos, as many citizens have joined the revolution. D-503 reflects that OneState must win, since reason must ultimately win.