Prisoner B-3087 is based on the true story of Yanek Gruener, a young Jewish boy who is 10 years old when the Nazis invade his home city of Kraków, Poland in September 1939. Yanek, his parents Oskar and Mina, and the rest of his family, who are all Jewish, are immediately subjected to restrictions on their freedoms. A Jewish ghetto is created, and Jewish people are not allowed to go to school or to own business. Soon, Nazis start to raid their homes and deport citizens to camps—where it is rumored that Jewish people are killed. Oskar tries to stay optimistic, but Yanek grows increasingly worried. After a raid on their home, Yanek discovers a pigeon coop where he and his family decide to live, hidden from the Nazis.
Three years into the Nazi occupation, Yanek turns 13, and his bar mitzvah ceremony (in which he becomes a man under Jewish law) is held under the cover of night in a basement—if Jews are discovered practicing their religion, they will be killed. Soon after this, Yanek’s mother and father are picked up while waiting for their bread rations, and Yanek never sees them again. Soon after, in late 1942, Yanek is deported as well. He arrives at Plaszów concentration camp, where he reunites with his uncle Moshe. Moshe explains that Yanek has to remain anonymous and not stand out or care about anything, because anything can be used as a reason for the Nazis to kill prisoners. He insists that they have to survive at all costs, because they cannot let the Nazis erase them from history. Yanek soon gets an introduction to the Nazis’ cruelty at his first roll call: the commandant at the camp, Amon Goeth, sics his dogs on the prisoner next to Yanek for no reason.
Moshe gets him Yanek a job cleaning the Kraków ghettos so that he can stay out of the camp as much as possible. This proves doubly lucky, as Yanek cleans out his family’s old apartment and finds the money that his mother had sewn into their family’s jackets. Yanek brings this money back to the camp, where Moshe is able to trade it for extra bread. Moshe tells him not to share it with anyone, though Yanek feels guilty about not sharing it with prisoners who have become “Muselmanners”—so skinny and dejected that they are essentially dead. Soon after Yanek acquires this extra money, however, Goeth murders Moshe because Moshe was assigned the leader of a group breaking rocks, and Goeth wasn’t been satisfied with their work. Yanek is devastated, thinking that he is alone once again.
As the years go on, Yanek is transferred wherever work is needed: first, to the Wieliczka salt mine, and then to Trzebinia concentration camp. At each of these places, the work is grueling and death is commonplace—the Nazis treat the Jewish prisoners worse than animals. Yanek thinks about fighting back, but when one prisoner resists during roll call at Trzebinia, he is immediately shot—and seven other innocent prisoners, including a young boy, are hanged in front of the rest. Yanek vows to remember the boy. Soon after, in winter of 1944, Yanek and other prisoners are loaded into a train car, where they are taken to Birkenau concentration camp. Another prisoner explains that they are going to be taken to the gas chambers. Yanek is distraught, thinking that all his work to survive had been for nothing. But when they are herded into the showers, water comes out instead of gas. Yanek is so relieved that he feels as though he’s been reborn. He is determined to continue to survive.
After the showers at Birkenau, Yanek’s head is shaved and a number is tattooed on his arm: B-3087. He is a number to the Nazis, rather than an individual. He then finds a prison uniform and a pair of shoes that fit. That night, a prisoner asks if there are 10 men to perform a boy’s bar mitzvah ceremony. Yanek volunteers, and when the ceremony is done, he echoes Moshe’s words that they cannot let the Nazis erase them. Meanwhile, during his time at Birkenau, Yanek washes every day to remind himself of his humanity. He also learns how to gain some strength by holding back in line for soup, so that he’s served the thicker part at the bottom. One day, prisoners try to break out, but they are caught and killed. The men on their work detail are also shot despite having done nothing wrong, and a guard opens fire on the remaining prisoners who are gathered for roll call—Yanek narrowly survives.
After a few months, Yanek is transferred to Auschwitz. There, despite Moshe’s warnings, he befriends a boy named Fred, who is also from Kraków. Yanek is grateful to talk to someone else, and to talk about his life and what he had been through. One day, however, Fred grows very sick and is unable to work. When he is unable to get up for roll call, the Nazis drag him out of the barracks and hang him. Yanek makes another vow never to forget Fred. In the winter of 1945, Yanek is transferred to Sachsenhausen, but this time there are no cars to take them, and so they walk there for days on end. Yanek notices a boy who can barely keep himself upright. The boy reminds Yanek of Fred, and so he helps take the boy’s weight as they walk. Later, another man helps Yanek carry the boy as well. When they stop for the night, Yanek realizes that in the process of carrying the boy, his bread portion fell out of his waistband. He nearly breaks down. He considers stealing from the boy but decides against it, thinking that the boy will likely die by the morning and that he can take the bread then. But the boy doesn’t die, and so Yanek walks three more days without any food.
Arriving at Sachsenhausen, Yanek and the other prisoners are given a brief period of rest which allows them to regain a bit of strength. Yanek continues to wash at a pump every day, marveling that he once owned the luxury of a toothbrush. Sachsenhausen brings much of the same as the other camps, as Yanek and the others are forced to break rocks and build barracks. But Yanek can tell that the Allied planes are getting closer. Soon after, Yanek is shipped by cattle car to Bergen-Belsen. The conditions at this camp are surprisingly better: there are no gas chambers, and they have more food than Yanek has eaten in six years. But Yanek soon discovers that there is a kapo nicknamed Moonface (for the scars and acne pits on his round face) who targets Yanek for no reason, beating him up whenever he can. Despite the better conditions, Yanek works to make sure he is transferred to another camp as quickly as possible to avoid Moonface.
Yanek is then moved to Buchenwald, where the prisoners are treated as lower than animals. This comparison is easy to make: there’s a zoo with wild animals at the camp which serves as entertainment for the guards in their families. The animals are fed better than the prisoners, though one day the Nazis drop a steak (normally fed to the bears) in front of two prisoners and force them to fight for it. Yanek once sees two Nazi soldiers tie one of the deer to a fence; later, they are punished harshly for it. Yanek observes that the Nazis will hypocritically tolerate cruelty to the prisoners, yet not to animals.
Yanek is then transferred to Gross-Rosen. One day, a kapo asks where the missing top button on Yanek’s shirt is. When Yanek says he doesn’t know, he is punished with 20 lashes—though the Nazi soldier whipping him continually restarts the count until Yanek blacks out from receiving so many. That night, Yanek hears bombs explode close to their barracks, and hopes the Allies are near. The prisoners in Gross-Rosen are then sent on a death march to Dachau without any food—Yanek believes they are continuing to move because the Allies are getting closer and closer to liberating them. Their path to Dachau runs through Czechoslovakia, and Yanek is heartened to see that many Czech villagers have left bread and other food on their doorsteps for the prisoners. Still, Yanek knows that without more food, he will die very soon. He notices a kapo ahead with four loaves of bread—much more than the man needs for himself. When Yanek approaches the kapo, he realizes that it’s Moonface. Despite his fear, Yanek approaches Moonface when they stop, explaining that he wants to work but needs food to live. Moonface, to Yanek’s surprise, cuts off a piece of bread for him.
At Dachau, the explosions come closer and closer to the camps, and in early spring, the prisoners wake to find that the Nazis have fled in the night. They are unsure what to do with themselves, how they might get back to their homes, or what they would even go back to. But then, in April 1945, American soldiers arrive to liberate them, and Yanek falls to his knees, sobbing in relief that he survived the war. A soldier approaches Yanek, asks him his name, and assures him that everything is going to be all right.
The liberated prisoners are taken away from Dachau and housed temporarily in Munich. Yanek is amazed when the American soldiers give him a bunk to himself, sheets, a pillow, a cup, a washcloth, and especially a toothbrush. That night at dinner, another survivor cries as they all sit down to eat their meal. Yanek thinks that even though they are relieved to be free, there is an immense amount of sadness in remembering those that they had lost. However, Yanek soon discovers that his cousin Youzek also survived. Youzek suggests that Yanek apply to a new program in America that’s helping Jewish orphans immigrate. After three years, Yanek’s papers finally come through. As Yanek boards the train that will take him to a ship bound for the U.S., he thinks about his family. He knows he will always remember them, but that starting over in America will allow him to live his life again.