The 'Lazy Song' singer will play Camden's Roundhouse in London on July 8. He joins a host of other acts for the month-long festival, including the recently-confirmed Moby and Swedish House Mafia.
A number of supporting acts have also been announced.
Jimmy Eat World support Foo Fighters on July 11, while The Naked and Famous and Alice Gold back White Lies on July 13.
Linkin Park are supported by Neon Trees on July 4, Errors play with Mogwai on July 23 and Nero with Chase & Status on July 28.
Tickets are free, and are available via a prize draw on the official iTunes festival website.
Mars topped the UK singles chart earlier this month with 'The Lazy Song'.
> What's the best UK festival?
Watch 'The Lazy Song' video below: