Lanez, 28, is accused of shooting the 25-year-old in both feet following a party in the Hollywood Hills in July.
He has been charged with assault with a semi-automatic firearm, carrying a loaded, unregistered firearm in a vehicle, and inflicting great bodily injury, Los Angeles District Attorney's Office said.
His arraignment will take place on 13 October and prosecutors say he faces a maximum sentence of 22 years and eight months in prison if convicted.
Lanez, real name is Daystar Peterson, is thought to have been in an SUV with Megan, whose real name is Megan Pete, on 12 July.
The pair got into an argument after going to a party and as Megan went to leave the car, Lanez shot "several times" at her feet, prosecutors claim.
Megan spoke about the alleged incident in an Instagram video, saying she was "extremely grateful to be alive" and describing it as a "traumatic night".
She told her followers that police took her to hospital where bullets were removed from her feet.
The 25-year-old, who is from Houston, said in the clip: "Yes ... Tory shot me. You shot me and you got your publicist and people to these blogs lying. Stop lying!"
Lanez, who is originally from Canada, previously denied shooting her, claiming in a song released last month that he had been framed.
In the song Money Over Fallouts, he says: "you get shot in your foot, don't hit no bones or tendons?"
Megan Thee Stallion was featured in Time magazine's 100 most influential people in the world list and her song Savage, which features Beyonce, was an international hit.