Is baptism necessary for salvation? For the average Christian, the obvious answer should be no. Like a beating drum, the New Testament only affirms one requirement for salvation: Faith. If you have true faith in the Son of God, particularly in His death for your sins, His resurrection by God, and His status as Lord, you are saved. By contrast, you'll be hard pressed to find a verse that can even be twisted to say that baptism, which is a work, is required for salvation.
Nevertheless, some people try, and none of those verses are so easily twisted as 1 Peter 3:21. Every translation says some variation of "baptism now saves you". But as usual, context is key. It is very irresponsible to take just one verse and ignore the rest. It's twice as irresponsible to take just one part of a verse and ignore the rest.
As I already explained, the entire New Testament affirms salvation by faith. The Bible, being the word of God, is not riddled with contradictions, and so this is the first clue that we are not dealing with a verse that requires baptism for salvation. So, what is the correct interpretation that is consistent with the rest of Scripture?
First, let us consider the parts of the verse most people cut off when trying to argue that salvation requires baptism. Peter specifically says that this is not the removal of filth from the flesh, but rather, baptism is the pledge of good conscience towards God. This is actually very important. In our day, believers can go weeks, months, even years after converting without getting baptised. In Peter's day, this was unfathomable, and I believe it still should be. When you believed, it was just expected that you would get baptised as soon as water became available. This is almost like signing a contract. A vow is binding without a contract, but it becomes more solid when such a contract is signed. Conversion is valid without baptism, but baptism makes that conversion public, and solid. It is, as Peter says, a pledge of good conscience towards God. I'll remind you, this is in the same verse! The only excuse for missing it is "I haven't actually read it".
From this, I hope it is clear that baptism, while not vital for salvation, is nevertheless very important. If you're a Christian and you're not baptised, get baptised. This was a command given by Jesus. Unless you have medical reasons not to, it is a sin to disobey. Do not think "I don't need it to be saved, therefore I don't need it at all". But at the same time, a believer who cannot be baptised (like the thief on the cross), dies on the way to get baptised, or is even just too cowardly/lazy to get baptised, will not lose salvation.
Just before telling us what baptism represents, Peter also describes a similar event involving salvation through water: Noah's flood. During the flood, the whole world died, saving only those on the ark. Baptism, Peter tells us, corresponds to this.
Regarding all of this, Dr. Kenneth Wuest, author of Word Studies in the Greek New Testament, writes "Water baptism is clearly in the apostle's mind, not the baptism by the Holy Spirit, for he speaks of the waters of the flood as saving the inmates of the ark, and in this verse, of baptism saving believers. But he says that it saves them only as a counterpart. That is, water baptism is the counterpart of the reality, salvation. It can only save as a counterpart, not actually. The Old Testament sacrifices were counterparts of the reality, the Lord Jesus. They did not actually save the believer, only in type. It is not argued here that these sacrifices are analogous to Christian water baptism. The author is merely using them as an illustration of the use of the word 'counterpart.' So water baptism only saves the believer in type. The Old Testament Jew was saved before he brought the offering. That offering was only his outward testimony that he was placing faith in the Lamb of God of whom these sacrifices were a type....Water baptism is the outward testimony of the believer's inward faith. The person is saved the moment he places his faith in the Lord Jesus. Water baptism is the visible testimony to his faith and the salvation he was given in answer to that faith. Peter is careful to inform his readers that he is not teaching baptismal regeneration, namely, that a person who submits to baptism is thereby regenerated, for he says, 'not the putting away of the filth of the flesh.' Baptism, Peter explains, does not wash away the filth of the flesh, either in a literal sense as a bath for the body, nor in a metaphorical sense as a cleansing for the soul. No ceremonies really affect the conscience. But he defines what he means by salvation, in the words 'the answer of a good conscience toward God," and he explains how this is accomplished, namely, 'by the resurrection of Jesus Christ,' in that the believing sinner is identified with Him in that resurrection."
The long and short of all this is that, far from Peter telling us baptism is essential for salvation, he actually tells us it is a response to salvation. Those who are saved should get baptised, just as surely as a sinning Jew would have brought sacrifices to atone for his sins. As the Old Testament is full of typology, so also is the New Testament. If you are not baptised, don't panic, but for goodness sake, get baptised as soon as possible. If you are baptised, don't assume that gets you off the hook. When you got baptised, you were pledging yourself in good conscience to God. Make sure you honor that.