Medical staff, day care workers, teachers and workers in community facilities must also be vaccinated under the law, which is due to take effect in March 2020, a Health Ministry spokesman told CNN.
There is a revival of measles – a highly contagious viral disease that can spread through the air when an infected person coughs or sneezes – around the world.
Symptoms of the disease – which can also spread through touching contaminated surfaces – may include fever, cough, runny nose, watery eyes and red spot rash.
Germany registered 501 cases of measles between January and mid-October 2019, according to the Ministry of Health.
Under the new law, parents will have to submit a certificate to the educational institution proving that their child has received both vaccines. Parents who do not inoculate their children will face a fine of 2,500 euros.
Daycare centers that accept unvaccinated children will also be charged, and children who are not vaccinated may be excluded from school, according to the ministry.
Nearly 350,000 cases of measles have been reported globally in 2018, according to the UNICEF – more than twice as many as in 2017.
Two doses of the measles vaccine are needed. According to the World Health Organization, about 95% of the population should be vaccinated with a two-dose vaccine against measles to ensure immunity to herds.
According to the German Ministry of Health, although 97.1% of first graders received the first vaccine, rates are not so high for the second network, meaning the country has not yet reached the 95% quota.
CNN's Rob Pichetta and Katie Hunt contributed to this report.