Medical staff, child care workers, teachers and workers in community facilities must also be vaccinated under the law, which will come into force in March 2020, a Ministry of Health spokeswoman told CNN.
There has been a revival of measles – a highly contagious viral disease that can spread through the air when infected people cough or sneeze – all over the world.
Symptoms of the disease – which can also spread through touching a contaminated surface – may include fever, cough, runny nose, runny eyes and red spots.
Germany has registered 501 cases of measles between January and mid-October 2019, according to the Ministry of Health.
Under the new law, parents must show certificates to educational institutions that prove that their child has received both vaccinations. Parents who do not inject their children will face a € 2,500 fine.
Child care centers that accept unvaccinated children will also be charged, and unvaccinated children can be expelled from schools, according to the ministry.
Nearly 350,000 cases of measles were reported globally in 2018, according to the UN children's agency UNICEF – more than double that of 2017.
Two doses of vaccine are needed to protect against measles. According to the World Health Organization, about 95% of the population needs to be vaccinated with two doses of measles vaccine to ensure herd immunity.
According to the German Ministry of Health, although 97.1% of first-year students have received the first vaccination, the level is not as high as for the second jab, which means the country has still not reached the 95% quota.
Rob Picheta and Katie Hunt from CNN contributed to this report.