Adam Hammill's late goal put Huddersfield into the third round of the Capital One Cup for the first time in 10 years.
Dale Stephens put Charlton ahead with a free-kick before Joel Lynch equalised from Oliver Norwood's pass.
Marvin Sordell put Charlton back in front on the turn but Jonathan Hogg netted for the hosts from 25 yards.
Hammill slammed in the winner when the ball fell kindly when James Vaughan jostled for Jon Stead's through ball.
Sorry, we were unable to load match stats, please try again.