1 (To the chief Musician, A Psalm of David.) O LORD, thou hast searched me, and known me.
2 Thou knowest my downsitting and mine uprising, thou understandest my thought afar off.
3 Thou compassest my path and my lying down, and art acquainted with all my ways.
4 For there is not a word in my tongue, but, lo, O LORD, thou knowest it altogether.
5 Thou hast beset me behind and before, and laid thine hand upon me.
6 Such knowledge is too wonderful for me; it is high, I cannot attain unto it.
7 Whither shall I go from thy spirit? or whither shall I flee from thy presence?
8 If I ascend up into heaven, thou art there: if I make my bed in hell, behold, thou art there.
9 If I take the wings of the morning, and dwell in the uttermost parts of the sea;
10 Even there shall thy hand lead me, and thy right hand shall hold me.
11 If I say, Surely the darkness shall cover me; even the night shall be light about me.
12 Yea, the darkness hideth not from thee; but the night shineth as the day: the darkness and the light are both alike to thee.
13 For thou hast possessed my reins: thou hast covered me in my mother's womb.
14 I will praise thee; for I am fearfully and wonderfully made: marvellous are thy works; and that my soul knoweth right well.
15 My substance was not hid from thee, when I was made in secret, and curiously wrought in the lowest parts of the earth.
16 Thine eyes did see my substance, yet being unperfect; and in thy book all my members were written, which in continuance were fashioned, when as yet there was none of them.
17 How precious also are thy thoughts unto me, O God! how great is the sum of them!
18 If I should count them, they are more in number than the sand: when I awake, I am still with thee.
19 Surely thou wilt slay the wicked, O God: depart from me therefore, ye bloody men.
20 For they speak against thee wickedly, and thine enemies take thy name in vain.
21 Do not I hate them, O LORD, that hate thee? and am not I grieved with those that rise up against thee?
22 I hate them with perfect hatred: I count them mine enemies.
23 Search me, O God, and know my heart: try me, and know my thoughts:
24 And see if there be any wicked way in me, and lead me in the way everlasting.
God knows all things. (1-6) He is every where present. (7-16) The psalmist's hatred to sin, and desire to be led aright. (17-24)1-6 God has perfect knowledge of us, and all our thoughts and actions are open before him. It is more profitable to meditate on Divine truths, applying them to our own cases, and with hearts lifted to God in prayer, than with a curious or disputing frame of mind. That God knows all things, is omniscient; that he is every where, is omnipresent; are truths acknowledged by all, yet they are seldom rightly believed in by mankind. God takes strict notice of every step we take, every right step and every by step. He knows what rule we walk by, what end we walk toward, what company we walk with. When I am withdrawn from all company, thou knowest what I have in my heart. There is not a vain word, not a good word, but thou knowest from what thought it came, and with what design it was uttered. Wherever we are, we are under the eye and hand of God. We cannot by searching find how God searches us out; nor do we know how we are known. Such thoughts should restrain us from sin.7-16 We cannot see God, but he can see us. The psalmist did not desire to go from the Lord. Whither can I go? In the most distant corners of the world, in heaven, or in hell, I cannot go out of thy reach. No veil can hide us from God; not the thickest darkness. No disguise can save any person or action from being seen in the true light by him. Secret haunts of sin are as open before God as the most open villanies. On the other hand, the believer cannot be removed from the supporting, comforting presence of his Almighty Friend. Should the persecutor take his life, his soul will the sooner ascend to heaven. The grave cannot separate his body from the love of his Saviour, who will raise it a glorious body. No outward circumstances can separate him from his Lord. While in the path of duty, he may be happy in any situation, by the exercise of faith, hope, and prayer.17-24 God's counsels concerning us and our welfare are deep, such as cannot be known. We cannot think how many mercies we have received from him. It would help to keep us in the fear of the Lord all the day long, if, when we wake in the morning, our first thoughts were of him: and how shall we admire and bless our God for his precious salvation, when we awake in the world of glory! Surely we ought not to use our members and senses, which are so curiously fashioned, as instruments of unrighteousness unto sin. But our immortal and rational souls are a still more noble work and gift of God. Yet if it were not for his precious thoughts of love to us, our reason and our living for ever would, through our sins, prove the occasion of our eternal misery. How should we then delight to meditate on God's love to sinners in Jesus Christ, the sum of which exceeds all reckoning! Sin is hated, and sinners lamented, by all who fear the Lord. Yet while we shun them we should pray for them; with God their conversion and salvation are possible. As the Lord knows us thoroughly, and we are strangers to ourselves, we should earnestly desire and pray to be searched and proved by his word and Spirit. if there be any wicked way in me, let me see it; and do thou root it out of me. The way of godliness is pleasing to God, and profitable to us; and will end in everlasting life. It is the good old way. All the saints desire to be kept and led in this way, that they may not miss it, turn out of it, or tire in it.Commentary by Matthew Henry, 1710.