Karasek qualified for the men's 200 m individual medley at the 2012 Summer Olympics in London, by breaking a Swiss record and eclipsing a FINA B-cut of 2:01.79 from the national championships in Zurich. He challenged seven other swimmers on the second heat, including Olympic veterans Bradley Ally of Barbados, Martin Liivamägi of Estonia, and Raphaël Stacchiotti of Luxembourg. He edged out Tunisia's Taki M'rabet to pick up a seventh spot by 0.06 of a second, lowering his own Swiss record to 2:01.35. Karasek failed to advance into the semifinals, as he placed twenty-eighth overall in the preliminaries.