Upon its release, "What the Hell" received positive reviews from music critics with many complimenting its catchiness and comparing it to her 2007 single "Girlfriend". The song was successful, reaching number one in Japan, the top five in Asia, the Top 10 in Europe, Australia, South America, Mexico, Canada, and the Top 20 in the US and the UK, peaking at eleven and sixteen, respectively.

An accompanying music video for the song was directed by Marcus Raboy and premiered on 23 January. "What the Hell" was performed by Lavigne on several television programs such as Dick Clark's New Year's Rockin' Eve, Daybreak, The View, The Tonight Show with Jay Leno and on the Much Music Video Awards, America's Got Talent and Britain's Got Talent. Additionally, she added the song to the setlist of The Black Star Tour (2011).

"What the Hell" is written by Lavigne, Max Martin, and Shellback, while the latter two produced the song. It was recorded at Maratone Studios in Stockholm, Sweden. This is the second song these three have written together, the first one being Miranda Cosgrove's "Dancing Crazy". On November 2010, Lavigne announced via a blog on her official website that her fourth album, Goodbye Lullaby, had been completed for a year and cited her record company as the reason for the album's delays. She revealed in the blog that "What the Hell" would be the first single from the album.[1] The song was premiered on 31 December 2010 on Dick Clark's New Year's Rockin' Eve[2] during a pre-taped segment along with a performance of "Girlfriend".[3] Lavigne described "What the Hell" as "a really fun, upbeat party song, so it worked out really well to play it for the first time on New Year's Rockin' Eve."[4] The following day, "What the Hell" was available as a free download for 48 hours from Lavigne's official Facebook page.[5]

"What the Hell" has been described as "bubblegumpop-punk"[6] and synthpop song[7].[8][9] The song has been compared to previous Lavigne's single, "Girlfriend" (2007). It is written in the verse–pre-chorus–chorus form. The track opens with its characteristically "retro keyboard riff" and hand-claps.[10] The inclusion of the keyboard has drawn comparisons to the garage rock genre and the band The Hives.[10][11] The song also features guitars during the chorus.[10] The song is performed in the key of A Major at a tempo of 150 beats per minute. Avril Lavigne's vocals span from F#3 to E5.

Although Lavigne simply described the song as "a broad message about personal freedom",[1] critics have interpreted it in various ways. Gil Kaufman of MTV.com suggested that it is a "declaration of independence from a former teen star who is storming back onto the scene". Kaufman proposed Lavigne's public divorce from Sum 41 singer Deryck Whibley, along with friction between her and her record company, as possible themes.[10] Jody Rosen of Rolling Stone magazine called the song "an anthem about a good girl... staying out late, swapping boys and exacting psychological revenge."[11] Heather McDaid of Stereoboard.com was critical of the song's theme being about Whibley: "with such an upbeat song it’s hard to envisage divorce as the underlying subject matter as you listen."[12] Holly Thomas of Frost Magazine suggested Lavigne was "starved of affection from the one she truly loves."[13] Lavigne described the song as "more reminiscent of some of my old pop rock stuff",[4] calling it her "most pop track on the record" and the least personal song from the album.[1]

"What the Hell" has received positive reviews from music critics, who have noted similarities between "What the Hell" and Lavigne's previous single, "Girlfriend".[10][13] Gil Kaufman of MTV.com stated "What the Hell" has "rousing cheerleader energy" and an "infectious groove and peppy vibe".[10] Jody Rosen of Rolling Stone magazine said "the music is easily some of Avril's catchiest yet", describing it as "Avril in a nutshell".[11]Idolator described the song as a "guilty pleasure" and called it "the kind of track we only select after double-checking no one's eyeing our iPod."[15] Nick Levine of Digital Spy gave the song a perfect rating. He explained that Lavigne is "snottier than a tissue tossed in the bin down the flu clinic [but] what's more, she's pulling it off." Levine added that "What the Hell" was not "quite as undeniable" as "Girlfriend" but praised the chorus of the song.[6]

Heather McDaid of Stereoboard.com notes that it "isn’t a revolutionary piece musically but it encompasses the pop-rock sound Avril has been creating over the years". McDaid goes on to say that it is "definitely a song that reflects the older, more fun loving Avril Lavigne."[12] Holly Thomas of Frost Magazine believed that the song lacked maturity and described it as "irritating", but she praised the song for its lyrics and theme.[13] Kirsten Coachman of Blogcritics simply said that people could easily relate to it.[14]

McDaid and Thomas all agreed that some might find the song annoying.[13][12] Jonathan Keefe from Slant Magazine was more positive: "Martin ensures that lead single "What the Hell" explodes into its chorus to great effect, making its slight refrain of "All my life I've been good/But now I'm thinking 'what the hell'" sound more massive than it probably should".[16] Andy Greenwald from Entertainment Weekly was almost neutral in his review, but admitted that the "Farfisa-fueled What the Hell [will] restore Avril to her rightful place ahead of Katy Perry and Ke$ha in the Sisterhood of the Negligible Pants".[17] Stephen Thomas Erlewine from Allmusic picked the track as one of the best of the album: "'What the Hell' approximates Avril’s irrepressible brattiness only without seeming much fun at all".[18]

"What the Hell" made its debut on the US Billboard Hot 100 on 19 January 2011 at number thirteen and on the US Billboard Hot Digital Songs at number six, with digital sales of over 166,000 units.[19] The following week, What the Hell fell to number 31 on the US Billboard Hot 100 and number 22 on Hot Digital Songs with register sales of 77,000[20] but climbed back up to 24 on the Billboard Hot 100 chart and 13 on the Hot Digital Charts on its third week, climbing to 23 on its fourth week. In its fifth week, it peaked at number 11 on Billboard Hot 100. The song debuted at number eight on the Canadian Hot 100. "What the Hell" also debuted at number four of Canada's Digital Songs chart, with 16,000 downloads. The single becoming Lavigne's third best debut to date, following "Girlfriend" and "Keep Holding On".[21] The song cracked the top-forty on Radio Songs, reaching number twenty-seven; her last single to chart on the Radio charts was "When You're Gone" (2007) at number thirty-seven. "What the Hell" surpassed this Radio Songs peak when it climbed to number thirty-four, being her most played song since "Girlfriend" (2007).[22] As of September 2015, the song sold 2.1 million digital copies in the USA.[23]

The single also debuted on the UK Singles Chart at number 29 on 23 January 2011, marking her twelfth top thirty hit on the chart. In its second charting week, the single fell to number 45, in its third week it rose to number 32, and in its eighth week, it has risen to a peak position of number 16.[24] The song debuted at No. 15 on the Oricon in Japan, and sold 5,598 copies the first week. It has been certified Gold in Australia in its third week for sales of 35,000 copies, and in its sixth week, it has been certified Platinum for sales over 70,000 copies, and has been certified 2x Platinum in its 16th week, for sales over 140,000.[25] "What the Hell" has been placed No. 1 in list of biggest hits of 2011 in Japan. With shipments, "What the Hell" sold an estimated 2 million copies in Asia. Even though it missed the top spot in Japan, it is the best selling Western single of 2011 there. It has sold more than 6 million copies worldwide, making it her second best selling single behind "Girlfriend" which sold more than 10 million copies worldwide.[26]

The video begins with Lavigne in her bra and panties lying in bed with her love interest, played by Spencer Hill. She gets out of the bed, applies her two fragrances, Black Star and Forbidden Rose, locks her love interest in a walk-in closet, and leaves the house. She walks down the road and steals a taxi. Lavigne's lover begins to chase her on a bike. She gets out of the taxi, which crashes into another vehicle. Lavigne stops to play in a basketball court with other men at the Sixth Street Viaduct. Her love interest finds her, and she runs into a vintage clothing store with an Abbey Dawn collection. Lavigne's mother, Judy, makes a cameo appearance as a clerk in the clothing store. Lavigne starts to grab various items of clothing, mainly pieces from Abbey Dawn. She changes, and walks through the store to a venue. Lavigne waits for her boyfriend in the corridor, and sings the bridge to him. She then runs to the stage and begins performing the final chorus with her band. She stage dives, and finds her love interest in the crowd. The video ends with Lavigne and her lover again lying in bed. The video directed by Marcus Raboy and recorded in 3D. It made its television debut on 23 January 2011,[28] on ABC Family[29] and on UK music channel 4Music. The New York Post criticized the video with its product placement for Sony and Abbey Dawn.[30] Mawuse Ziegbe of MTV said, "Avril Lavigne is officially back, and if her latest video 'What The Hell' is anything to go by, she's still brimming with the pop-punk spunk that made her a superstar nearly a decade ago."[29]