The 23-year-old was due to be a free agent next summer, but Gary Monk has moved to retain the services of a player who impressed toward the tail end of last season following a loan spell at Birmingham City.
Bartley says that he hopes to play a much bigger role for the Swans next season.
"I spoke to the manager after the last game of the season at Sunderland and he was keen to extend my contract," Bartley told the club's official website.
"It's brilliant for me because it's a show of faith from the club and manager, and this season I really want to repay them for that by playing games and doing myself and the club proud.
"The season is demanding with the Premier League and cup competitions, so everyone in the squad will be used and it's up to them to perform and keep their spot in the team."