The story of the woman caught in adultery is found in John 8:1–11. Briefly, the story involves the scribes and Pharisees who, in their continuing efforts to trick Jesus into saying something they could hold against Him, brought to Him a woman caught in adultery. They reminded Him that the Mosaic Law demanded her to be stoned to death. “But what do you say?” they asked Him. At this point, Jesus stooped down and starting writing something in the dirt. When He straightened up, He said, “If any one of you is without sin, let him be the first to throw a stone at her” (John 8:7). Then He stooped down and wrote again. One by one, the people left (verses 8–9).
The Jewish leaders had already disregarded the Law by arresting the woman without the man. The Law required that both parties to adultery be stoned (Leviticus 20:10; Deuteronomy 22:22). The leaders were using the woman as a trap so they could trick Jesus. If Jesus said the woman should not be stoned, they would accuse him of violating Moses’ Law. If He urged them to execute her, they would report Him to the Romans, who did not permit the Jews to carry out their own executions (John 18:31).
There is a lot of speculation about what Jesus was writing, including the idea that He was writing a list of the sins committed by each of the Jewish leaders present. Another theory is that, since the woman was “caught in the act” of adultery, perhaps she was naked, and Jesus was writing in the dirt to avert His eyes from seeing the naked woman. Both of these ideas are possible, but there is no way to know for certain. The point of the passage is not what was being written in the dirt, but rather that hypocrisy in judging others is forbidden. Because Jesus upheld the legal penalty for adultery—stoning—He could not be accused of being against the Law. But by saying that only a sinless person could throw the first stone, He highlighted the fact that no one is without sin and the importance of compassion and forgiveness.