Malala is a vociferous supporter of education for girls. Her outspoken advocacy for girls' education made her a Taliban target. She was shot in the left eye socket at close range on a school bus on October 16, 2012 in Pakistan.
The book excerpt describes how she gradually regained her sight and her voice and was reunited with her parents.
Malala, who has been mentioned as a possible contender for the Nobel Peace Prize to be announced Friday, also describes her amazement at finding out that some 8,000 people had sent messages of support to the hospital.
"Rehanna, the Muslim chaplain, said millions of people and children around the world had supported me and prayed for me," Malala writes. "Then I realized that people had spared my life. I had been spared for a reason. I realized that what the Taliban had done was make my campaign global."
Malala, who is now residing in the U.K., also described her goal of one day returning to Pakistan despite the risks: "To be torn from the country that you love is not something to wish on anyone," she writes.
The book is titled "I am Malala: The Girl Who Stood Up for Education and Was Shot by the Taliban."
The Associated Press contributed to this report.