Marc Lépine was born Gamil Rodrigue Liass Gharbi on October 26, 1964, in Montreal, Quebec, the son of Algerian immigrant Rachid Liass Gharbi and Canadian nurse Monique Lépine. Gamil's sister, Nadia was born in 1967.  His father Rachid, who was a mutual funds salesman, was travelling in the Caribbean at the time of his son's birth. During his absence, his mother Monique discovered evidence that her husband had been having an affair. Rachid was a non-practising Muslim, and Monique a former Catholic nun who had rejected organized religion after she left the convent. Their son was baptized a Roman Catholic as an infant, but received no religious instruction during his childhood; his mother described her son as "a confirmed atheist all his life".
Instability and violence marked the family: it moved frequently, and much of Lépine's early childhood was spent in Costa Rica and Puerto Rico, where his father was working for a Swiss mutual funds company. The family returned to Montreal permanently in 1968, shortly before a stock market crash led to the loss of much of the family's assets. Rachid was an authoritarian, possessive and jealous man, frequently violent towards his wife and his children. He had contempt for women and believed that they were intended only to serve men. He required his wife to act as his personal secretary, slapping her if she made any errors in typing, and forcing her to retype documents in spite of the cries of their toddler. He was also neglectful and abusive towards his children, particularly his son, and discouraged any tenderness, as he considered it spoiling.
In 1970, following an incident in which Rachid struck Gamil so hard that the marks on his face were visible a week later, his mother decided to leave. The legal separation was finalized in 1971, and the divorce in 1976. Following the separation, Gamil lived with his mother and younger sister Nadia; soon after, their home and possessions were seized when Rachid defaulted on mortgage payments. Gamil was afraid of his father, and at first saw him on weekly supervised visits. The visits ended quickly, as Rachid ceased contact with his children soon after the separation. Gamil never again saw his father, and in the future refused to discuss him with others.
Rachid stopped making support payments after paying them twice, and to make ends meet, Monique returned to nursing. She subsequently started taking further courses to advance her career. During this time the children lived with other families during the week, seeing their mother only on weekends. Concerned about her children and parenting skills, she sought help for the family from a psychiatrist at St. Justine's Hospital in 1976; the assessment concluded there was nothing wrong with the shy and withdrawn Gamil, but recommended therapy for his sister Nadia, who was challenging her authority.  Nadia Gharbi died in 1996 at age 28 from a drug overdose.
After the divorce became final in 1976, the children, then aged 12 and 9, returned to live with their mother, who was director of nursing at a Montreal hospital. In 1977, the family moved to a house purchased in the middle-class Montreal suburb of Pierrefonds. Gamil Gharbi attended junior high and high school, where he was described as a quiet student who obtained average to above average marks. He developed a close friendship with another boy, but he did not fit in with other students. Taunted as an Arab because of his name, at the age of 14 he legally changed it to "Marc Lépine", citing his hatred of his father as the reason for taking his mother's surname. Lépine was uncommunicative and showed little emotion. He suffered from low self-esteem, exacerbated by his chronic acne. Family relations remained difficult; his younger sister Nadia publicly humiliated him about his acne and his lack of girlfriends. He fantasized about her death, and on one occasion made a mock grave for her. He was overjoyed when in 1981 she was placed in a group home because of her delinquent behaviour and drug abuse.
Seeking a good male role model for Lépine, his mother arranged for a Big Brother. For two years, the experience proved positive as Lépine, often with his best friend, enjoyed the time with photography and moto-cross motorcycles. However, in 1979 the meetings ceased abruptly when the Big Brother was detained on suspicion of molesting young boys. Both Lépine and his Big Brother denied that any molestation had occurred. Lépine owned an air rifle as a teenager, which he used to shoot pigeons near his home with his friend. They also enjoyed designing and building electronic gadgets. He developed an interest in World War II and an admiration of Adolf Hitler, and enjoyed action and horror movies. Lépine also took considerable responsibility at home, including cleaning and doing repairs while his mother worked.
Lépine applied to join the Canadian Forces as an officer cadet in September 1981 at the age of 17, but was rejected during the interview process. He later told his friend it was because of difficulties accepting authority, and in his suicide letter, noted that he had been found to be "anti-social". An official statement from the military after the massacre stated that he had been "interviewed, assessed and determined to be unsuitable".
In 1982 at the age of 18, the family moved to Saint-Laurent, closer to his mother's work and to Lépine's new Cégep. He lost contact with his school friend soon after the move. This period marks the beginning of the seven years which he described in his suicide note as having "brought [him] no joy".
In August 1982, Lépine began a two-year pre-university course in pure sciences at Cégep de Saint-Laurent, failing two courses in the first semester but improving his grades considerably in the second semester. He worked part-time at a local hospital where his mother was director of nursing, serving food and doing custodial work. He was seen as nervous, hyperactive, and immature by his colleagues. He developed an attraction to another employee, but he was too shy to act on his feelings. After a year at college, he switched from the university-destined science program into electronics technology, a three-year technical program geared more towards immediate employment. His teachers remembered him as being a model student, quiet, hardworking and generally doing well in his classes, particularly those related to electrotechnology. There was an unexplained drop in his marks in the fall 1985 term, and in February 1986, during the last term of the program, he suddenly and without explanation stopped attending classes, as a result failing to complete his diploma.
He moved out of his mother's home into his own apartment, and in 1986 he applied to study engineering at École Polytechnique de Montréal. He was admitted on the condition that he complete two compulsory courses, including one in solution chemistry. In 1987, Lépine was fired from his job at the hospital for aggressive behaviour, as well as disrespect of superiors, and carelessness in his work. He was enraged at his dismissal, and at the time described a plan to commit a murderous rampage and then commit suicide. His friends noted that he was unpredictable, flying into rages when frustrated.
In the fall of 1987, in order to complete his college diploma, Lépine took three courses, obtaining good marks in all of them, and in February 1988, began a course in computer programming at a private college in downtown Montreal, funding his studies with government student loans. He moved into a downtown apartment with his old high school friend, and in the winter of 1989 took a CEGEP night-course in solution chemistry, a prerequisite course for the École Polytechnique. Lépine wanted a girlfriend, but was generally ill at ease around women. He tended to boss women around and show off his knowledge in front of them. He spoke out to men about his dislike of feminists, career women and women in traditionally male occupations, such as the police force, stating that women should remain in the home, caring for their families. Lépine applied again to the École Polytechnique in 1989; however his application was rejected as he lacked required courses. In March 1989 he abandoned the course in computer programming, though he performed well in the CEGEP course, obtaining 100% in his final exam. In April 1989 he met with a university admissions officer, and complained about how women were taking over the job market from men.