Town squandered numerous chances to seal victory and were almost made to pay late on when Keith Andrews saw his shot hit both posts.
Pablo Counago had the ball in the net after just five minutes, but he was clearly offside when he collected a loose ball after Neil Cutler had beaten out an Alan Mahon shot.
Counago had another great chance four minutes later when he fired in an angled shot from eight yards which Cutler turned around the post.
Jermaine Wright should have put Town ahead but sidefooted a Jim Magilton corner wide from five yards before Gifton Noel-Williams missed Stoke's first chance, heading a Karl Henry corner over.
Kelvin Davis held a low Noel-Williams shot, and after a quiet spell, Stoke had an excellent chance when Andrews fed Carl Asaba, who shot wastefully into the side netting.
Town went ahead on 43 minutes when Magilton headed back a cross from the right and Richards smashed a shot high beyond Cutler.
Andrews sent a stoppage time curler inches wide, and Town then turned up the heat at the start of the second half.
Counago saw a powerful shot held by Cutler, who then denied the Spaniard in a one-on-one situation, before substitute Tommy Miller fired a good chance over.
Cutler produced two more fine saves to turn aside shots from Shefki Kuqi and Miller, and then Georges Santos saw his header from an Ian Westlake corner cleared off the line by Henry.
Town could have rued those misses when, with two minutes to go, Darel Russell crossed to Andrews whose side foot shot struck both posts before rebounding into the grateful arms of Davis.