Psalm 51:1-11: "1 Have mercy on me, O God, according to your steadfast love; according to your abundant mercy blot out my transgressions. 2 Wash me thoroughly from my iniquity, and cleanse me from my sin!
"3 For I know my transgressions, and my sin is ever before me. 4 Against you, you only, have I sinned and done what is evil in your sight, so that you may be justified in your words and blameless in your judgement. 5 Behold, I was brought forth in iniquity, and in sin did my mother conceive me. 6 Behold, you delight in truth in the inward being, and you teach me wisdom in the secret heart.
"7 Purge me with hyssop, and I shall be clean; wash me, and I shall be whiter than snow. 8 Let me hear joy and gladness; let the bones that you have broken rejoice. 9 Hide your face from my sins, and blot out all my iniquities. 10 Create in me a clean heart, O God, and renew a right spirit within me. 11 Cast me not away from your presence, and take not your Holy Spirit from me."
Ezra 9:15: "'O LORD, the God of Israel, you are just, for we are left a remnant that has escaped, as it is today. Behold, we are before you in our guilt, for none can stand before you because of this.'"
Hebrews 9:14: "how much more will the blood of Christ, who through the eternal Spirit offered himself without blemish to God, purify our conscience from dead works to serve the living God."
Luke 18:13: "'But the tax collector, standing far off, would not even lift up his eyes to heaven, but beat his breast, saying "God, be merciful to me, a sinner!"'"
+++
The text is public domain:
To Thee, omniscient Lord of all,In grief and shame I humbly call;I see my sins against Thee, Lord,The sins of thought and deed and word.They press me sore; I cry to Thee:O God, be merciful to me!
O Lord, my God, to Thee I pray:O cast me not in wrath away!Let Thy good Spirit ne'er depart,But let Him draw to Thee my heartThat truly penitent I be:O God, be merciful to me!
O Jesus, let Thy precious bloodBe to my soul a cleansing flood.Turn not, O Lord, Thy guest away,But grant that justified I mayGo to my house at peace with Thee:O God, be merciful to me!
+++
The recurring line "O God, be merciful to me" comes from Luke 18:13, but otherwise, the hymn comes primarily from the passage from Psalm 51. Verses 10 and 11 appear most clearly in the second verse.
Ezra 9:15 appears in the first verse, and Hebrews 9:14 in the third, although there's a bit of overlap here with verses 2 and 7 in Psalm 51.