"When You're Gone" was primarily written by Avril Lavigne and Ben Moody, with additional contributions from Kelly Clarkson and Butch Walker.