The film opens in 1939, with acclaimed Polish pianist Wladyslaw Szpilman playing for the radio. In the middle of the performance, the studio gets bombed, a sign of the incursion of Nazi soldiers. Wladyslaw goes home to find his family packing their things to leave, but once they hear that Great Britain and France have declared war against Germany, they decide to remain in Warsaw.
Soon after, the Nazi regime declares that every Jew must wear an armband to mark them while they are in the streets. The Nazi soldiers begin to harass and kill Jewish people, before moving them into walled ghettos within the city. Szpilman's brother, Henryk, gets arrested by the Jewish police working with the Nazis, but Szpilman is able to convince a policeman he knows to set him free. Shortly after, the family is packed together and taken to a station, where they must wait to be taken away to Nazi camps. Just before he boards, Szpilman gets rescued by the Jewish policeman that set his brother free, who tells him to make a run for it. This is the last time Szpilman sees his family.
Szpilman goes into hiding outside the ghetto and must rely on others to provide food for him. He has to leave his first hiding spot after he breaks a shelf of dishes and the neighbor demands to see his papers. He flees to a safe house and gets placed in his own flat by an old acquaintance, but supplies come very slowly and his health deteriorates. When his building is bombed, he must escape the Nazis first by hiding out in a bombed-out hospital and then by taking refuge in the attic of a building in his old ghetto, which is now completely abandoned.
In the attic, he gets discovered by a German officer, Hosenfeld, who asks him to play the piano. Moved by his playing, Hosenfeld decides to bring food to Szpilman and keeps him alive. Before leaving Warsaw, the officer gives Szpilman his coat to keep him warm while he waits for the Allied forces. When Allied forces come into the city they nearly kill Szpilman as they mistake his coat for a sign of his German-ness. Szpilman returns to Polish society, where he plays piano professionally, until his death at 88 in 2000.