Spike Lee's Malcolm X is based entirely upon his autobiography as told to Alex Haley. In the book, Malcolm relays the story of his life, from his earliest childhood memories through the weeks leading up to his assassination. As a youth he grew up in poverty and was surrounded by tragedy and loss. His father died a mysterious and violent death, which Malcolm believes was murder at the hands of a local white supremacist organization. Following her husband's death, Malcolm's mother slowly began to lose her sanity, brought on by the strain of raising eight children alone and without sufficient income. The children were subsequently taken by the social services and split up amongst various foster homes. Malcolm's adolescence was spent learning various hustles as he grew into a criminal and drug addict in New York's Harlem. Eventually his transgressions landed him in prison where he converted to Islam and transformed his life. Following his stint in prison, Malcolm became one of the most recognizable and influential spokesmen for the Nation of Islam. The autobiography is written from Malcolm's perspective towards the final years of his life.
Much of the film is taken directly from the source, such as Malcolm being told that "a lawyer is no realistic goal for a nigger" by his English teacher. There are, however, some major discrepancies between the film and the book. For example, in the book, Malcolm is turned on to Islam by some of his brothers and sisters. In the film, the fictional character Baines is used in place of Malcolm's siblings and an educated prison inmate named Bimbi.
Malcolm's message in the film is taken from the parts of his autobiography when he reflects on his past, interjecting his contemporary outlook and philosophy. Most of the movie deals with the Malcolm's call for Black people to "wake up" and start to respect themselves. The major focus in the latter half of the book is more on Malcolm's political agendas. There is very little of the political posturing that became central at the end of Malcolm's life.
Producer and friend of Malcolm, Marvin Worth, bought the screen rights to the autobiography in 1969. James Baldwin, with the assistance of Arnold Perl, wrote the original screenplay on which Malcolm X was based. Spike Lee contributed to the final version of the script, mostly in the third act. Dealing with Malcolm's split from the Nation of Islam and the events surrounding his assassination had apparently been problematic for the previous screenwriters. With many of the key players and their descendants alive at the time of the writing, early screenwriters like Baldwin were wary of assuming too much. Lee sees the NOI as responsible for Malcolm's assassination along with help or compliance from the FBI and CIA, which come across in the third act in subtle and not-so-subtle ways.