Do Androids Dream of Electric Sheep? is set on a dying, post-war Earth from which most people have already emigrated. Rick Deckard, a bounty hunter, is assigned to hunt down six escaped androids, who are all the latest model and nearly impossible to detect. The only way to tell a human from an android is to administer an empathy test; empathy is highly valued as the only characteristic separating man from machine. As Deckard finds and brutally destroys the "andys," he is faced with uncomfortable questions about his own humanity.
In post-apocalyptic 1992 (or, in later editions, 2021), after "World War Terminus," the Earth's dust-irradiated atmosphere leads the United Nations to encourage mass emigrations to off-world colonies to preserve humanity's genetic integrity, with the incentive of free personal androids: robot servants identical to humans. On Earth, owning real live animals is a status symbol for keeping up with the Joneses, because of mass extinctions and the accompanying cultural push for greater empathy that has motivated a technology-based religion called Mercerism. Poor people can only afford realistic-looking electric animals, including Deckard, who owns a robotic black-faced sheep. Mercerism uses "empathy boxes" to simultaneously link users to a collective virtual reality of communal suffering, centered on a martyr-like character, Wilbur Mercer, who eternally climbs up a hill while being hit with crashing stones.
The story also contains passing mention to "Penfield mood organs", which fill the role that mind-altering drugs take in other Dick stories. The mood organ can induce any desired mood in the people nearby, such as "an optimistic business-like attitude" or "the desire to watch television, no matter what is on". A slightly ironic passage in the opening chapter has Deckard and his wife, Iran, discussing what settings to use to start the day. She announces that she has scheduled six hours of "existential despair" for later in order to deal with their loneliness in an almost-deserted apartment building.
Bounty hunter Rick Deckard signs on to a new police mission to earn enough money to buy a live animal to replace his electric sheep, seeking greater existential fulfillment for himself and his depressed wife, Iran. The mission involves hunting down ("retiring") a group of six Nexus-6 androids that violently went rogue and fled from Mars to Earth after their creation by the Rosen Association. Deckard visits Rosen headquarters in Seattle to confirm the validity of a question-and-answer empathy test: a method for identifying any androids posing as humans. Deckard is greeted by Rachael Rosen, who quickly fails his test. Rachael attempts to bribe Deckard into silence, but he verifies that she is indeed a Nexus-6 android used by Rosen to try to discredit the test.
Deckard soon meets a Soviet police contact, who turns out to be one of the disguised Nexus-6 renegades. Deckard retires the android, then flies off to retire his next target: Luba Luft, an opera-singing Nexus-6. This android, however, has him arrested by a police officer he has never met and detained at a police department he has never known. At this strange police station, Deckard's worldview is shaken when an official named Garland accuses Deckard himself of being an android. After a series of increasingly mysterious revelations at the police station, Deckard for the first time ponders the ethical and philosophical questions his line of work raises regarding android intelligence, empathy, and what it really means to be human. Phil Resch, the station's bounty hunter, finally gets testing equipment to determine if his coworkers as well as Deckard are androids or humans. Finally, Garland reveals that the entire station is a sham, completely staffed by androids, including Garland himself. Resch shoots Garland in the head and escapes with Deckard; together, they find and arrest the android opera singer, which Resch suddenly, brutally retires in cold blood. Although Resch and Deckard are now collaborating, each still worries that the other, or himself, might be an android. Deckard at last administers the empathy test to himself and Resch alike, which confirms that Resch is just a particularly ruthless human being, and that Deckard is also human, but with empathy for androids.
Only three of the Nexus-6 android fugitives remain, and one, Pris Stratton, moves in to an apartment building whose only other inhabitant is John R. Isidore, a radioactively-damaged, intellectually slow human classified as a "special." The lonely Isidore attempts to befriend her. Roy and Irmgard Baty, the final two rogue androids, visit the building, and they all together plan how to survive. Meanwhile, Deckard with his reward money buys Iran an authentic Nubian goat. After quitting work, Deckard is pulled back in after being notified of a new lead and experiencing a vision of the prophet-like Mercer confusingly telling him to proceed though his mission is immoral. Deckard calls back upon Rachael Rosen, since her own insider knowledge as an android will aid his investigation. Rachael reveals that she and Pris are the same exact model, meaning that he will have to shoot down an android that looks just like her. Rachael coaxes Deckard to have sex, after which they mutually confess their love, but she reveals she has slept with multiple other bounty hunters in order to dissuade them from their missions. After threatening to kill her, Deckard abruptly deserts her.
Isidore develops friendships with the three android fugitives, and they all watch a television program giving definitive evidence that Mercerism is a hoax. Roy Baty tells Isidore that the show was produced by androids to discredit Mercerism and blur the distinction with humans. Suddenly Deckard enters the building, with supernatural warning visions of Mercer appearing to both him and Isidore. Deckard becomes legally justified in shooting down all three androids without testing them, since they attack him first, and he successfully does so. Isidore is devastated, and Deckard is soon rewarded for a record number of Nexus-6 kills in one day. When Deckard returns home, he finds Iran grieving because Rachael Rosen recently showed up and murdered their goat.
Deckard goes to an uninhabited, obliterated region of Oregon to reflect. He climbs a hill when he is hit by falling rocks and realizes this is an experience similar to Mercer's. Rushing back to his car, he stumbles abruptly upon a toad, an animal previously thought to be extinct, and one of the animals sacred to Mercer himself. With newfound joy, Deckard brings the toad home, where Iran quickly discovers that it is just a robot. While Deckard is unhappy, he decides that he at least prefers to know the truth: whether the toad is real or artificial, remarking with an exhausted reflection upon the events that have taken place that "The electrical things have their lives too, paltry as those lives are".