Almost no one asks this question idly. It usually arrives at two in the morning, and it usually arrives with a specific sin attached.
The fear runs like this: forgiveness applies to what I have confessed, so a sin I have not confessed is still on the books, and if I die before I get to it, that is the one that undoes me. It is a coherent fear, given the premise. The premise is the problem.
Scripture assumes you will not get them all
David asks, “Who can know all his errors? Please do not let me be guilty of sins I am unaware of” (Ps 19:12 NET). Sit with what that prayer takes for granted. It assumes there are sins he cannot see, cannot name, and therefore cannot itemize. And it does not treat this as a crisis. It treats it as ordinary, and it asks God to handle it.
That is the biblical posture toward the list. It is not a completeness exercise. Luther says the same thing in the Small Catechism: before God we plead guilty of all sins, including those we do not recognize in ourselves, and in private confession we name the ones that actually trouble us. Not all of them. The ones weighing on the conscience. The enumeration was never the point, and the Lutheran Confessions explicitly reject the idea that forgiveness depends on a full recital of sins, since such a recital is impossible.
If it were possible, it would still be the wrong foundation. A salvation contingent on the completeness of your inventory rests on the quality of your self-knowledge. That is a terrible place to put your weight, and it is not where God put it.
The last moment does not decide
There is a version of this fear that treats the moment of death as a snapshot: whatever state you are caught in is the state you are judged in. It is the same logic that once made people believe suicide damns automatically, and the same logic that made deathbed absolution seem like the crucial event of a Christian life.
It is a theology of works wearing a clock. It says you are saved by the condition of your final hour rather than by Christ, and it makes the timing of your death the decisive fact about your eternity.
Scripture will not let that stand. Paul is exhaustive on purpose: neither death nor life, neither the present nor the future, nothing in all creation can separate us from the love of God in Christ Jesus (Rom 8:38-39 NET). Death is on that list. It made the list precisely because we would otherwise assume it was the exception. And Hebrews says Christ is able to save completely those who come to God through him, because he always lives to intercede (Heb 7:25 NET). Not intermittently. Not between confessions.
The psalmist puts it as a question with an obvious answer: if God kept a record of sins, who could stand? (Ps 130:3 NET). The point is that no one could, including the person who confessed most recently and most thoroughly. That is why forgiveness has to be forgiveness rather than bookkeeping.
Then why confess at all?
Because it is good for you, not because it is load-bearing.
Confession and absolution exist to deliver a comfort you can hear. There is a difference between believing in general that God forgives sinners and hearing a man say to you, by name, on Christ’s own authority, that your sins are forgiven. The first is a doctrine. The second is a gift handed to you. That is what private confession is for, and why the Reformation kept it rather than abolishing it. (See What Is Private Confession? and What Is the Office of the Keys?.)
So confess the sin that is keeping you awake. Not because the transaction fails without it, but because you were never meant to carry it alone, and because Christ has arranged for it to be taken off you audibly.
The short answer
You will die with unconfessed sin. Everyone does, and everyone always has, including the saints whose deaths the Church remembers most gratefully. What you will also die with is a Baptism you did not perform, a promise you did not invent, and an intercessor who has not stopped. Those are the facts that decide the matter.
Scripture cited: Psalm 19:12 · Psalm 130:3-4 · 1 John 1:7-9 · Romans 8:38-39 · Hebrews 7:25
Confessions cited: Small Catechism V (Confession) · Augsburg Confession XI (Confession) · Augsburg Confession XXV (Confession) · Apology XII (Repentance)