The law fundamentally bans the use of mobile phones in all preschools and primary schools, as well as middle school.
The move had been a campaign demand by centrist President Emmanuel Macron.
French students are already not allowed to use their mobile phones during class, and each school can decide individually to implement rules that go even further.
With the new law, that position will be reversed: The use of mobile phones is generally banned in the entire school, with each one deciding to make exceptions to that rule.
The News Agency of Nigeria recalled that Senators and national assembly deputies reached the agreement late Wednesday on the ban for all three tiers of French education (primary, middle and high school), except for educational purposes.
Teachers have been calling for the ban to curtail a growing distraction in classrooms, with nearly nine out of ten French teens aged 12 to 17 now owning a smartphone.
Besides cutting down on screen time, the bill also aims to protect children from dangerous online content such as violence or pornography, as well as cyberbullying.
Each school will decide how to apply the ban, for example by making students hand them over when entering school premises or requiring them to keep them turned off in their backpacks.