His father was an enamel painter who originally came from a family of wine merchants in Alsace. His brother, Joseph Krafft (1786-1828) also became a painter of portrait miniatures. By the age of ten, he was already attending a drawing school.
In 1799, he and sister were sent to live with an aunt in Vienna. He immediately enrolled at the Academy of Fine Arts, where he studied history painting with Heinrich Friedrich Füger. In 1802, he travelled to Paris with Veit Hanns Schnorr von Carolsfeld to continue his studies. There, he made the acquaintance of Jacques-Louis David and François Gérard, who had a major influence on his style.