Most of Edgar Huntly is related in a long letter from Edgar to his fiancée, Mary. The story takes place in Pennsylvania only a few years after the Revolutionary War.
He begins by reminding her about his grief over the recent and unsolved murder of her brother, Waldegrave. While thinking one night about how he might investigate the crime, he walked by the elm tree where the man's body had been found, and saw a figure digging in the earth and crying out. Edgar assumed this was the murderer, and noticed that this man seemed to be sleepwalking.
He eventually determined that this figure must be Clithero Edny, an Irish immigrant who worked for a neighbor. Edgar confronted Clithero with the accusation, and the immigrant then volunteered his tale of woe as answer.
Clithero told about how he was born a poor man but was adopted as servant and confidante by Mrs. Lorimer, a lovely middle-aged widow. They lived together in England. Though they had a pleasant life, she had a malevolent twin brother, Arthur Wiatte, who constantly caused trouble. She regularly defended him until he committed a terrible crime and she refused to come to his aid. He was then sent off on a ship as prisoner, and was believed to have died in a failed mutiny.
Meanwhile, Mrs. Lorimer adopted Clarice, Arthur's illegitimate daughter. Clithero and Clarice fell in love, even though their distinction in social classes made a union unlikely. However, Mrs. Lorimer ensured that they could be married, and they made plans to do so once Clarice had visited a dying friend elsewhere in the country.
During her time away, Mrs. Lorimer's life-long love, Sarsefield, returned to England. He and Mrs. Lorimer had hoped to marry in their youth, but Arthur ensured that she married a cruel but rich man. Now that the situation was favorable, they resumed a relationship, and Sarsefield also grew close to Clithero.
Unfortunately, the men learned that Arthur Wiatte had not only survived at sea, but had in fact returned to London. They agreed not to tell Mrs. Lorimer. One night, Arthur attacked Clithero on the street, and Clithero killed him from self-defense. Though absolved of the crime by witnesses, he was desperately unhappy at the pain Arthur's death would cause Mrs. Lorimer. In a fit of madness and mental perturbation, he entered her chamber and rationalized killing her in order to save her from the grief. However, as he was about to stab the sleeping figure, Mrs. Lorimer herself stepped from the shadows and stopped him. Realizing then that he was actually about to stab his beloved Clarice, Clithero tried to kill himself. When Mrs. Lorimer also stopped him from committing this act, he fled the room and then to America, where he now lived.
After hearing Clithero's story, Edgar felt sympathetic to the man. He was also surprised to hear of his old tutor, Sarsefield, who had left Pennsylvania when Edgar was younger and not stayed in touch. After Clithero intimated he would kill himself and then fled into the wilderness, Edgar resolved to follow him in hopes of providing some comfort and convincing him that he was not as culpable as he believed.
In this vast and cruelly beautiful wilderness, Edgar traveled until he had to navigate through a pitch-black cave. He finally located Clithero, who was emaciated but sleeping soundly. Edgar decided to leave food for him, and not to disturb his rest.
After returning home, Edgar was invited to the home where Clithero worked, and there learned that the immigrant had left a mysterious box behind. Edgar decided to pry it open in hopes of learning more about Clithero, but broke it in the process. He also dug in the ground where Clithero had been digging, and discovered a manuscript which Mrs. Lorimer had written about her brother and which Clithero had kept.
Edgar returned to the wilderness, but was kept from re-entering Clithero's cavern by a ravenous panther. Luckily, the panther perished in trying to leap a chasm towards Edgar. While fleeing the beast, Edgar accidentally left the manuscript behind.
Back at home, Edgar discovered that a packet of Waldegrave's letters, which he had kept after the man's death in hopes of preparing them for publication, were missing. This strange discovery was matched by his uncle's story of having heard someone walking in the room above Edgar's late at night. Edgar was understandably confused.
The next day, a man named Weymouth visited Edgar, claiming that he had left a considerable sum of money in his friend Waldegrave's care before the man died. As Waldegrave had indeed left behind a large amount of unexplained money to Mary, the story seemed plausible. Unfortunately, Edgar and Mary relied on that inheritance to facilitate their marriage, but he writes to her that they must do the right thing and return it to Weymouth.
Edgar then warns Mary that his story is about to grow quite terrible and marvelous.
After the day Weymouth visited, Edgar awoke from a deep slumber into a dark pit. In great pain and with no idea how he arrived there, he considered suicide but eventually found a way to scale to pit walls. He immediately encountered another panther, and instinctively killed it with his tomahawk (which he had luckily brought with him somehow). He then ate its raw flesh to assuage his hunger.
He followed the sound of water, and emerged in a cavern where four Indians (Native Americans) were sleeping. He hated Indians because his parents had been killed by such savages, and he planned to sneak past them to warn others that this raiding party was coming near. Before he left the cavern, one Indian woke and walked outside, and Edgar noticed that a farmer's daughter had been taken captive. Edgar stole a musket and hatchet, killed the Indian outside, and then rescued the girl.
They eventually came upon a simple hut, and rested. While there, he was shocked to realize that the musket he stole from the Indians was in fact his very own gun. He had to conclude that the Indians had attacked his uncle's house and killed his family. He considered returning to the cavern to take revenge, but he noticed that the surviving Indians were actually approaching the hut.
In a fire-fight, he killed two Indians. Suddenly, a group of white settlers arrived, recognizing the girl. Edgar fainted before he could explain anything, and woke to find he had been left alone. Realizing that his appearance convinced the white men he was dead, he traveled onwards, first killing the surviving Indian whom he found nearby. He took the man’s tomahawk.
Edgar got lost several times on his way home, despite getting directions from a woman who also fed him and told him that settlers were out looking for a man whom he understood to be himself. She also revealed that the hut he found belonged to Old Deb, an elderly Indian woman also known as Queen Mab. Old Deb was strange and talkative, and had refused to leave the land when her brethren were chased away by settlers.
On his way home after leaving the woman's house, Edgar was miserable, but could not rest because of the cold. At one point, he saw men in the distance, and fired on them, assuming they were Indians. When they fired back, he leapt into a river from a mountain overlook, and swam to the other side.
As he traveled closer to home, Edgar saw more evidence of the Indian attacks on the frontier. He stopped at a mansion he recognized for information, and there found evidence that someone had recently been in an upstairs room. He was shocked to find Waldegrave's letters on the desk in that room, and even more shocked when Sarsefield entered the room.
Sarsefield, recently returned to America, told him how he had seen Edgar sleepwalking when he first entered the area, and how he and Edgar's uncle had then set out searching for Edgar. Edgar's uncle had taken his gun, which is how it ended up with the Indians, since they killed Edgar's uncle in a skirmish. Further, it had actually been Sarsefield whom Edgar had fired upon from the mountain overlook, and the party only returned fire because they thought him an Indian. Sarsefield had Waldegrave's letters because he had found them in Edgar's upstairs room after realizing that Edgar was suffering from sleepwalking.
Edgar then told him about Clithero, but Sarsefield was angry to think of the man he considered a reprobate. Edgar softened Sarsefield's resolve by telling him the immigrant's side of the story, but Sarsefield maintained suspicion. When Clithero's mangled body was brought to the house after having been attacked by Indians, Sarsefield refused to help him as a surgeon.
Edgar sat with the wounded Clithero, who spoke of his sad life in the wilderness. Sarsefield confessed to Edgar that he had indeed married Mrs. Lorimer and that she and Clarice were now in New York, but asked him not to tell the immigrant.
Clithero was less wounded than they thought, and disappeared into the night. A few days later, Old Deb was arrested for facilitating Waldegrave's murderer by telling some other Delaware Indians to do it. Edgar ends his letter to Mary here.
There are three short letters after Edgar’s narrative concludes. In the first, Edgar writes Sarsefield in a hurry, saying he accidentally told Clithero that Mrs. Lorimer was in New York. He warns that Clithero is coming.
In the second letter, Edgar explains further how he learned that Clithero was living in Queen Mab's hut, and then visited him there. Though he realized that Clithero had gone mad, he accidentally revealed where she lived.
In the last letter, Sarsefield chastises Edgar, explaining that Mrs. Lorimer suffered a miscarriage when learning that Clithero was coming, and that Sarsefield had to apprehend Clithero, who then killed himself while en route to a mental hospital.