Psalms 40
People in this chapter
Anyone who has been stuck - in grief, in sin, in a trouble with no visible bottom - knows exactly the difference between clay and rock under the feet.
And out of that deliverance God does something characteristic: He puts a new song in David's mouth. David sings about the rescue so that many shall see it, and fear, and shall trust in the LORD.1
Tap any highlighted phrase to jump to the commentary that unpacks it.

Psalm 40:1-5 · To the chief Musician, A Psalm of DavidHe Brought Me Up Out of an Horrible Pit
1I waited patiently for the LORD; and he inclined unto me, and heard my cry. 2He brought me up also out of an horrible pit, out of the miry clay, and set my feet upon a rock, and established my goings. 3And he hath put a new song in my mouth, even praise unto our God: many shall see it, and fear, and shall trust in the LORD. 4Blessed is that man that maketh the LORD his trust, and respecteth not the proud, nor such as turn aside to lies. 5Many, O LORD my God, are thy wonderful works which thou hast done, and thy thoughts which are to us-ward: they cannot be reckoned up in order unto thee: if I would declare and speak of them, they are more than can be numbered.
The opening testimony moves from unstable ground to established movement. Deliverance gives the singer both a place to stand and a way to continue, so the rescue is pictured as the restoration of a life that had been trapped.
The new song has a public effect: the singer's experience becomes a reason for others to trust. The move from personal rescue to the blessing of verse 4 gives testimony a place in the formation of the worshipping community.
The focus widens from a single deliverance to works and thoughts beyond the singer's ability to count. Remembered help becomes part of a larger testimony to God's concern, preparing the later prayer that those same mercies continue.
Psalm 40:6-10Lo, I Come to Do Thy Will
6Sacrifice and offering thou didst not desire; mine ears hast thou opened: burnt offering and sin offering hast thou not required. 7Then said I, Lo, I come: in the volume of the book it is written of me, 8I delight to do thy will, O my God: yea, thy law is within my heart. 9I have preached righteousness in the great congregation: lo, I have not refrained my lips, O LORD, thou knowest. 10I have not hid thy righteousness within my heart; I have declared thy faithfulness and thy salvation: I have not concealed thy lovingkindness and thy truth from the great congregation.
The strong language about sacrifice is joined to opened ears and a willing response. It questions worship separated from readiness to obey; the God-appointed offerings and the life of the worshipper belong together as the singer presents himself before the LORD.
The movement from opened ears to an obedient heart now reaches public speech. Repeated refusals to conceal God's character make proclamation an expression of the willingness already voiced, with the great congregation as its setting.
Psalm 40:11-17I Am Poor and Needy; Yet the Lord Thinketh upon Me
11Withhold not thou thy tender mercies from me, O LORD: let thy lovingkindness and thy truth continually preserve me. 12For innumerable evils have compassed me about: mine iniquities have taken hold upon me, so that I am not able to look up; they are more than the hairs of mine head: therefore my heart faileth me. 13Be pleased, O LORD, to deliver me: O LORD, make haste to help me. 14Let them be ashamed and confounded together that seek after my soul to destroy it; let them be driven backward and put to shame that wish me evil. 15Let them be desolate for a reward of their shame that say unto me, Aha, aha. 16Let all those that seek thee rejoice and be glad in thee: let such as love thy salvation say continually, The LORD be magnified. 17But I am poor and needy; yet the Lord thinketh upon me: thou art my help and my deliverer; make no tarrying, O my God.
Lovingkindness and truth connect the proclamation in verse 10 with the plea in verse 11. The singer must depend on the same gifts he tells others about, allowing testimony and continuing need to remain part of one prayer.
The two uncountable quantities create a striking tension: wonderful works in verse 5 and overwhelming iniquities in verse 12. The singer's desire to do God's will does not prevent honest confession, which keeps the renewed appeal for mercy deeply personal.
The closing petitions closely resemble Psalm 70, giving this plea a life elsewhere in the Psalter. The contrast between those seeking the singer's destruction and those seeking God keeps the prayer wider than self-preservation: it also asks for the worshippers' joy.
Research trail
Sources & further study
These references support the historical, linguistic, manuscript, and contextual notes in this chapter. Scripture remains the primary text; external sources are provided so readers can inspect the research directly.
- Psalm 40 - Translators' NotesThe NET Bible's detailed footnotes on Psalm 40 - the “pit” and “miry clay” as images of near-death trouble, the “new song” of the rescued, and the much-discussed relationship between the Hebrew “opened ears” (v. 6) and the Greek “a body hast thou prepared me” that Hebrews 10 follows.
- Psalm 40 · Hebrew + classical Jewish commentaryThe Hebrew text of Psalm 40 with Rashi, Ibn Ezra, and other classical commentators side by side - useful for the intensive qavoh qivviti (v. 1, “waiting I waited”), the striking idiom oznayim karita li (v. 6, “ears hast thou dug / opened for me”), and chaphets (v. 8, “to delight in, to take pleasure in”).
- Psalm 40 ↔ Hebrews 10 · Psalm 70 · 1 Samuel 15Traces the verbal threads tying Psalm 40's “Lo, I come” to its great fulfillment in Hebrews 10:5-10, its near-duplicate in Psalm 70 (vv. 13-17), and the prophets' refrain that God desires obedience above sacrifice (1 Sam. 15:22; Hos. 6:6).
Where this echoes in Scripture
He Brought Me Up Out of an Horrible Pit
- Psalm 30:3O LORD, thou hast brought up my soul from the grave... that I should not go down to the pit.Psalm 30 also uses the image of being brought up from a pit, recalling verse 2.
- Isaiah 40:31They that wait upon the LORD shall renew their strength; they shall mount up with wings as eagles.The same qavah / waiting (v. 1) that ends not in disappointment but in renewed strength.
- Revelation 5:9And they sung a new song... for thou wast slain, and hast redeemed us to God by thy blood.The rescued sing a new song to the Lamb, as David sings a new song in verse 3.
- Psalm 69:2I sink in deep mire, where there is no standing: I am come into deep waters.The miry clay (v. 2) named from the inside - the helplessness God reaches into.
Lo, I Come to Do Thy Will
- Hebrews 10:5-10A body hast thou prepared me... Lo, I come... to do thy will, O God... by the which will we are sanctified.Hebrews applies vv. 6-8 to Jesus and speaks of His offering once for all.
- 1 Samuel 15:22To obey is better than sacrifice, and to hearken than the fat of rams.The prophets' refrain behind v. 6: God always wanted the obedient self, not the substitute.
- Jeremiah 31:33I will put my law in their inward parts, and write it in their hearts.The promise fulfilled in “thy law is within my heart” (v. 8) - obedience from the inside out.
- John 4:34My meat is to do the will of him that sent me, and to finish his work.The “Lo, I come” of vv. 7-8 lived out: doing God's will as the Son's very food.
I Am Poor and Needy; Yet the Lord Thinketh upon Me
- 2 Corinthians 8:9Though he was rich, yet for your sakes he became poor, that ye through his poverty might be rich.The One of “Lo, I come” became poor and needy (v. 17) Himself, to make us rich.
- Psalm 70:1Make haste, O God, to deliver me; make haste to help me, O LORD.Psalm 70 closely follows the prayer for help in verses 13-17.
- Psalm 34:6This poor man cried, and the LORD heard him, and saved him out of all his troubles.The poor and needy one (v. 17) is exactly the one God draws near to hear.
- Matthew 5:3Blessed are the poor in spirit: for theirs is the kingdom of heaven.The gospel keeps the shape of v. 17 - the kingdom opens first to the poor and needy.