Colonel Herncastle, an unpleasant former soldier, brings the Moonstone back with him from India where he acquired it by theft and murder during the Siege of Seringapatam. Angry at his family, who shun him, he leaves it in his will as a birthday gift to his niece Rachel, thus exposing her to attack by the stone's hereditary guardians, who, legend says, will stop at nothing to retrieve it.
Rachel wears the stone to her birthday party, but that night it disappears from her room. Suspicion falls on three Indian jugglers who have been near the house; on Rosanna Spearman, a maidservant who begins to act oddly and who then drowns herself in a local quicksand; and on Rachel herself, who also behaves suspiciously and is suddenly furious with Franklin Blake, with whom she has previously appeared to be enamoured, when he directs attempts to find it. Despite the efforts of Sergeant Cuff, a renowned detective, the house party ends with the mystery unsolved, and the protagonists disperse.
During the ensuing year there are hints that the diamond was removed from the house and may be in a London bank vault, having been pledged as surety to a moneylender. The Indian jugglers are still nearby, watching and waiting. Rachel's mother dies, increasing her grief and isolation, and she first accepts and then rejects a marriage proposal from her cousin Godfrey Ablewhite, a philanthropist who was also present at the birthday dinner and whose father owns the bank near Rachel's old family home. Finally Franklin Blake returns from travelling abroad and determines to solve the mystery. He first discovers that Rosanna Spearman's behaviour was due to her having fallen in love with him. She found evidence (a paint smear on his nightclothes) that convinced her that he was the thief and concealed it to save him, confusing the trail of evidence and throwing suspicion on herself. In despair at her inability to make him acknowledge her despite all she had done for him, she committed suicide, leaving behind the smeared gown and a letter he did not receive at the time because of his hasty departure abroad.
Now believing that Rachel suspects him of the theft on Rosanna's evidence, Franklin engineers a meeting and asks her. To his astonishment she tells him she actually saw him steal the diamond and has been protecting his reputation at the cost of her own even though she believes him to be a thief and a hypocrite. With hope of redeeming himself he returns to Yorkshire to the scene of crime and is befriended by Mr. Candy's assistant, Mr. Ezra Jennings. They join together to continue the investigations and learn that Franklin was secretly given laudanum during the night of the party (by the doctor, Mr. Candy, who wanted revenge on Franklin for criticising medicine); it appears that this, in addition to his anxiety about Rachel and the diamond and other nervous irritations, caused him to take the diamond in a narcotic trance, to move it to a safe place. A re-enactment of the evening's events confirms this, but how the stone ended up in a London bank remains a mystery solved only a year after the birthday party when the stone is redeemed. Franklin and his allies trace the claimant to a seedy waterside inn, only to discover that the Indians have got there first: he is dead and the stone is gone. Under the dead man's disguise is none other than Godfrey Ablewhite, who is found to have embezzled the contents of a trust fund in his care and to have been facing exposure soon after the birthday party. The mystery of what Blake did while in his drugged state is solved: he encountered Ablewhite in the passageway outside Rachel's room and gave the Moonstone to him to be put back in his father's bank, from which it had been withdrawn on the morning of the party to be given to Rachel. Seeing his salvation, Ablewhite pocketed the stone instead, and pledged it as surety for a loan to save himself temporarily from insolvency. When he was murdered, he was on his way to Amsterdam to have the stone cut; it would then have been sold to replenish the plundered trust fund before the beneficiary inherited.
The mystery is solved, Rachel and Franklin marry, and in an epilogue from Mr. Murthwaite, a noted adventurer, the reader learns of the restoration of the Moonstone to the place where it should be, in the forehead of the idol in India.