Who Wrote Psalm 51? David's Prayer of Repentance
Psalm 51 is David's prayer of repentance after his sin with Bathsheba. Learn the evidence for his authorship and what this psalm teaches about confession.
Psalm 51 is a psalm of David. Its title names him directly, and it ties the psalm to a specific moment in his life: when the prophet Nathan came to him after his adultery with Bathsheba. That same event is recorded in 2 Samuel 11–12, where David takes another man’s wife and arranges her husband’s death, and Nathan confronts him with a parable and the words, “You are the man.” David’s reply — “I have sinned against the LORD” — is the confession this psalm expands into prayer. So the short answer is: David wrote it, and he wrote it as a sinner who had been found out and who cast himself on God’s mercy.
What does the title of Psalm 51 tell us?
The heading in the Hebrew text reads, “For the choirmaster. A Psalm of David. When Nathan the prophet came to him after his adultery with Bathsheba” (see Psalm 51:1, BSB). These titles are part of the psalms as they have come down to us, and they were not added at random. They place each psalm in a setting. Here the setting is one of the darkest chapters of David’s reign.
The psalm itself matches that setting. It speaks of bloodguiltiness (Psalm 51:14), which fits a man who has had Uriah killed. It speaks of a broken spirit and a crushed heart, which fits a man who has been confronted and has nothing left to say in his own defence. Nothing in the psalm contradicts the title; everything in it fits.
Did David really write it, or was the title added later?
Some readers wonder whether the titles are original. The evidence points to David. The headings are ancient, and the New Testament treats David as a real author of psalms. In Acts 4:25, Peter and John pray to God and say, “You spoke by the Holy Spirit through the mouth of Your servant, our father David,” quoting Psalm 2. The Bible’s own habit is to take David’s authorship seriously.
That said, the Book of Psalms is a collection. Easton’s Bible Dictionary notes that only a portion of the psalms claim David as author; about 73 carry his name, and roughly two-thirds of the whole collection have been ascribed to him. Other writers, like Asaph and the sons of Korah, contributed too. So Psalm 51 is one psalm within a larger book, and its title is not a guess but a claim.
What was happening in David’s life when he prayed this?
Second Samuel 11 tells the story plainly. David stayed home from war, saw Bathsheba bathing, sent for her, and slept with her. She became pregnant. David then tried to cover it up, and when that failed, he had her husband Uriah placed at the front line where he would be killed. He married Bathsheba. The chapter ends with a chilling sentence: “But the thing that David had done was evil in the sight of the LORD” (2 Samuel 11:27, BSB).
God sent Nathan. Nathan told a story about a poor man’s lamb, and David burned with anger at the rich man in the story. Nathan told him plainly that he was the man. David’s response was not to argue. He said, “I have sinned against the LORD” (2 Samuel 12:13, BSB). Psalm 51 is that moment turned into prayer. It is not a general psalm about sin; it is one man’s specific confession of a specific sin.
What does Psalm 51 actually say?
David begins with God’s character, not his own feelings: “Have mercy on me, O God, according to Your loving devotion; according to Your great compassion, blot out my transgressions” (Psalm 51:1, BSB). He asks to be washed and cleansed (verse 2). He admits that his sin is always before him (verse 3). He says something startling: “Against You, You only, have I sinned and done what is evil in Your sight” (verse 4). He does not mean that Bathsheba and Uriah do not matter. He means that every sin is first an offence against God, and that God is right to judge it.
He then asks for a clean heart: “Create in me a clean heart, O God, and renew a right spirit within me” (Psalm 51:10, BSB). He asks not to be cast from God’s presence and not to lose the Holy Spirit (verse 11). He asks for restored joy (verse 12). And he promises that when he is restored, he will teach other sinners God’s ways (verse 13).
The psalm ends with a striking line: “The sacrifices of God are a broken spirit; a broken and a contrite heart, O God, You will not despise” (Psalm 51:17, BSB). David is not saying that sacrifices do not matter. He is saying that God will not accept a ritual from a heart that is still proud and unrepentant. The heart comes first.
What does this psalm teach about confession?
Confession, in Psalm 51, is not bargaining. David does not offer God anything in exchange for forgiveness. He appeals to mercy. He names his sin. He asks to be made clean. He asks for a new heart, because he knows that he cannot fix himself.
This is the pattern the whole Bible gives. “If we confess our sins, He is faithful and just to forgive us our sins and to cleanse us from all unrighteousness” (1 John 1:9, BSB). The promise is not that we will feel better immediately, but that God forgives because of Christ. David looked forward to a sacrifice he did not yet fully understand; we look back to the cross, where Christ bore the penalty for sins like David’s and like ours.
One honest note: confession to God is not the same as confession to a priest. Roman Catholic Christians believe that sacramental confession is made to a priest, and this site does not replace that. But every Christian tradition agrees that sin must be brought to God, named honestly, and left with Him. Psalm 51 is the model prayer for doing exactly that.
Is Psalm 51 only for people who have committed a serious sin?
No. David’s sin was serious, but the psalm’s logic applies to every sin. All sin is against God. All of us need a clean heart. The psalm does not say that it is only for those whose sin is bad enough. It says, in effect, that this is how a sinner comes. That includes the person whose sin is private and small in the eyes of others, and the person whose sin has damaged other people badly.
If your sin has hurt someone, confession to God is the beginning, not the end. Scripture also calls us to repent, to apologise, to make restitution where we can, and to seek reconciliation. David’s story continues beyond Psalm 51 into the consequences of his sin, and those consequences were real. Forgiveness is free; it does not erase all earthly results.
How should you pray a psalm like this?
Read it slowly. Pray it as your own prayer. Do not rush past verse 3, where David says his sin is always before him. Do not rush past verse 10, where he asks for a new heart. Let the psalm shape your words when you do not have your own.
If you are carrying something heavy, speak to a pastor or a trusted believer in person. Confession spoken aloud to God, and sometimes to another Christian, breaks the isolation that sin creates. If what you are carrying includes thoughts of suicide or self-harm, please reach out for help right away. In the United States and Canada, call or text 988. In the United Kingdom and Ireland, call Samaritans on 116 123. In Australia, call Lifeline on 13 11 14. Anywhere else, visit findahelpline.com or call your local emergency number.
David wrote Psalm 51 as a guilty man who had been found out. He wrote it as a man who knew that God’s mercy was his only hope. That is still the best place to begin.
Questions people ask
Did David write Psalm 51?
Yes. The title of Psalm 51 names David and ties the psalm to the time Nathan the prophet confronted him after his sin with Bathsheba. The psalm’s contents — its confession of bloodguiltiness, its plea for a clean heart — fit that setting exactly.
What was David’s sin that led to Psalm 51?
David committed adultery with Bathsheba and then arranged for her husband Uriah to be killed in battle. The prophet Nathan confronted him, and David confessed, “I have sinned against the LORD” (2 Samuel 12:13). Psalm 51 is that confession turned into prayer.
Is Psalm 51 a prayer for forgiveness?
Yes. It is one of the clearest prayers of repentance in Scripture. David asks God to blot out his transgressions, wash him clean, and create in him a clean heart (Psalm 51:1, 10). It ends by saying God will not despise a broken and contrite heart.
Can I pray Psalm 51 for my own sin?
Yes. The psalm was written for a specific sin, but its pattern applies to every sin. If you have sinned, you can bring it to God honestly, ask for mercy, and ask Him to renew your heart. Speaking with a pastor or trusted believer can help you take the next step.