I don’t know. The Bible doesn’t say. It is certainly possible that they do. It is also possible that they don’t. It is, in turn, possible that some go to heaven when they die and some do not. Christians have, over the years dealt with this heart-wrenching question a number of different ways.
Some suggest that such children have no need to be saved from the wrath of God because they do not stand guilty before Him. While most of these would agree that even the youngest are tainted by sin (see Psalm 51:5), a few go so far as to suggest that the very young are without sin. Both positions suggest that the Bible leaves room for what they call the “age of accountability,” an unknown time (some suggest age 13 on the basis of the practice of bar mitzvah, when a Jewish boy becomes a man) when children do become responsible before God for their sin. The closest supportive text here is II Samuel 12:21-23.
Some suggest that the children of believers are welcomed to heaven, and leave open the question of the end of the children of unbelievers. The best text in defense of this position is I Corinthians 7:14, where the children of at least one believing parent are said to be “holy.”
Still others take the position that the elect among those dying in the womb go to heaven, and leave open the question of whether or not all or only some such children are elect. Finally, some take a mildly agnostic position, suggesting that “the God of heaven and earth will do rightly.”
I, though I agree that all and only the elect will enter into heaven, and that the judge of all the earth will do rightly, embrace none of these positions. In the end I believe that the texts cited do not warrant the conclusions drawn from them. Thus my bold response- I don’t know. What I am persuaded of is this. All humans, from conception, are sinners and stand guilty before a holy God. Their only hope is the work of Christ applied to them. That work is applied always and only through faith, and that only the faith of the one saved. Babies in heaven are there not by virtue of their age, nor their election, nor their parents. They are there by virtue of Christ, applied to them by their Spirit-given faith.
But can unborn babies believe? Not by themselves, just like you and me. It takes a supernatural work of the Holy Spirit to make that happen. Do we have reason to believe that He sometimes makes that happen? II Samuel 12:21-23 suggests He might. I Corinthians 7:14 suggests He might. Add to that John leaping in the womb at the presence of Christ (Luke 1:41) and we have reason to hope.
This could, of course, include all children dying in the womb. It could include none of them. Either way the Judge of all the earth would have done rightly. This is, clearly enough, an emotional issue. It is not, in my own life, merely abstract. My wife and I lost seven children to miscarriage, and have one precious 14 year old with the capacities of a one year old. Our emotions, however, should not lead us to add to the Bible, nor to muddy the precious saving waters of the work of Christ given to us by faith. Our hope for them is the same as our hope for anyone. We are all sinners, and all without hope save for the work of Christ. But praise be to His name, He came into this world to save sinners.
-R.C. Sproul Jr., http://www.ligonier.org/blog/do-all-those-who-die-womb-go-heaven/