The 18-year-old moves from Scotland to Wales for an undisclosed fee, signing a three-and-a-half-year contract at the Liberty Stadium.
King, who broke into the Hearts first team this season, said that it was tough to leave his boyhood club.
"I've left a passionate club and I'm arriving at another passionate club," he told Swansea's official website.
"It's always going to be hard to leave the club that you love, your home and your family as well, but coming to Swansea, where they're building something special here, it's a very good club to be at.
"The way Swansea play football is brilliant and will suit me down to a tee. I like to get the ball down and play, not force passes, and get around the pitch."