Andrew Neiman (Miles Teller) is a first-year jazz student at the prestigious Shaffer Conservatory in New York. He has been playing drums from a young age and aspires to become one of the greats like Buddy Rich. Conductor Terence Fletcher (J. K. Simmons) accepts Andrew into his studio band as the alternative for core drummer Carl (Nate Lang). Fletcher is abusive toward his students, mocking and insulting them; when the band rehearses the Hank Levy piece "Whiplash" and Andrew struggles to keep tempo, Fletcher hurls a chair at him, slaps him, and otherwise humiliates him in front of the class.
Determined to impress Fletcher, Andrew practices until his hands bleed and breaks up with his girlfriend Nicole (Melissa Benoist), believing she will distract him. At a local jazz competition, Andrew misplaces Carl's sheet music; as Carl cannot play without it, Andrew steps in informing Fletcher that he can perform "Whiplash" from memory. Fletcher promotes him to core drummer. However, Fletcher soon replaces him with Ryan (Austin Stowell), the core drummer from Andrew's former class.
The next day, Fletcher tearfully reveals in class that a talented former student of his, Sean Casey, has died in a car accident. The band rehearses "Caravan", but Ryan struggles with the tempo; Fletcher auditions Andrew, Ryan and Carl for hours while the class waits outside. Fletcher finally gives the position to Andrew.
On the way to a jazz competition, Andrew's bus breaks down. Determined to make the performance, he rents a car but arrives late without his drumsticks. After an argument with Fletcher, Andrew drives back to the car rental office and retrieves the drumsticks. As he speeds back, his car is hit by a truck. He crawls from the wreckage and arrives on stage badly injured. When he struggles to play "Caravan" due to his injuries, Fletcher stops the band midway through the performance to tell Andrew, he is "done". Andrew attacks Fletcher in front of the audience and is dragged away.
Days later, Andrew is expelled from Shaffer and meets with a lawyer representing the parents of Sean Casey. The lawyer explains that Sean actually hanged himself, having suffered anxiety and depression after joining Fletcher's class. Sean's parents want to prevent Fletcher from teaching. Andrew agrees to testify, resulting in Fletcher being fired.
Months later, Andrew sees Fletcher performing at a club. They drink together and Fletcher explains that he pushes his students beyond the expected so they might achieve greatness. He invites Andrew to perform at a festival concert with his band. Andrew agrees and invites Nicole, but she is in a new relationship and declines.
On stage at the jazz festival, Fletcher reveals to Andrew that he knows he testified against him. In revenge, Fletcher leads the band in a new piece for which Andrew was not given sheet music. Andrew leaves the stage humiliated, but returns and begins "Caravan", interrupting Fletcher as he addresses the audience. The rest of the band joins him, surprising Fletcher, who quickly follows suit. Andrew ends the performance with an extravagant drum solo, and Fletcher gives him a nod of approval.