This question is one I have agonized over for the most of my time as a pastor. And it’s not because the Bible is ambiguous on the subject, but because there's never a shortage of parents wanting to see their children baptized. I can't blame them for that, but many times I find myself in the position of having to speak with the parents and explain to them that water baptism does not guarantee one's salvation. I know of several instances when parents rushed their children into being baptized for the wrong reasons and this often brought about confusion later on. My own parents had me baptized as an infant although I'm not certain what they really believed it accomplished.
A little background may be helpful. In the early 5th century AD, a man named Augustine rose to prominence in the church and became bishop of Hippo in North Africa. Augustine was brilliant and his writings are still studied today, but some of what he believed wasn't thoroughly biblical. On the subject of water baptism, for example, Augustine believed that all who receive water baptism become recipients of a regenerating grace. This belief was passed along to the Roman Catholic Church and continues to be a popular idea today. It's actually a lovely thought. The only problem is that this idea is nowhere found in Scripture. Even so, there are still many people today who are stuck in the mindset that baptism guarantees one’s future salvation and because of this, they wish to have their loved ones baptized.
But what does the Bible really say about water baptism?
Water Baptism is only ever portrayed in God's Word as an act of obedience on the part of those who have already come to faith in Jesus as Savior. The act itself of being baptized is a declaration of one's identification with Jesus in His death, burial and resurrection — all depicted beautifully as the new believer is lowered into the waters of baptism (signifying our identification with Christ in His death) and then immediately raised again (indicating our identification with Jesus in His resurrection).
While I completely agree that children can fully know and understand the Gospel and truly be born again, I do not agree that they can fully grasp the idea of water baptism in terms of what it represents. This is because the idea of entering into Jesus' death (which we depict in water baptism) speaks to the issue of dying to self and recognizing that we are now called to choose Jesus over the life of the flesh that wars against the life of the Spirit. And having died to self, water baptism goes on to symbolize the reality of being raised to new life through the power of the Spirit. The life of the Spirit and the life of the flesh are concepts that small children find very difficult to grasp, but I believe they are essential for making our motivation for being baptized in water truly biblical.
My wife and I raised four kids of our own and I have to tell you I wish I had encouraged them to wait until they were older and better able to understand what they were doing. I believe I robbed them of what could have been a more meaningful and genuine expression of their faith.
So, what age is best? That's hard to say because we grow and mature at different levels. When a child comes to the place of understanding the life of the flesh versus the life of the Spirit, and how we are called to die to self and live to Christ, they will then be ready to express that understanding in the waters of baptism. Until then, the very last thing we want to do in a child's life is to leave them with the impression that they were baptized in water and as a result, everything concerning heaven is all settled. We are not saved by being baptized in water. We are saved by placing our faith in the finished work of Jesus Christ on the cross.