After beginning professionally with FC Lausanne-Sport and Neuchâtel Xamax, he was part of the 2005–06 and 2006–07 Super League-winning teams of Fussballclub Zürich.
In May 2007, Margairaz signed a three-year contract with Spanish side CA Osasuna,[2] where he struggled with first-team opportunities.
After a successful surgery in Geneva, he missed UEFA Euro 2008 as his recovery process was estimated to be of at least eight months;[3] this happened a week after another serious knee-injured central midfielder of the Navarrese club, Javad Nekounam, began training.
On 15 September 2009, Margairaz became Zürich's first scorer in the UEFA Champions League, netting in a 2–5 home loss against Real Madrid in the group stage.
[6] A member of the Swiss national team since 2005, Margairaz was called up to the 2006 FIFA World Cup, where he had two late substitute appearances.