The move follows reports some pupils have been using socks and toilet paper or even staying off school when having their period because they cannot afford tampons or towels.
The Welsh government announced it would fund the £2.3m scheme with immediate effect.
The announcement follows the Scottish government’s funding of free sanitary products in all schools, colleges and universities last year. A similar scheme is expected to be introduced for English secondary schools from September.
The new Welsh government grant will provide more than 141,000 female students with a range of sanitary products free of charge.
First minister of Wales Mark Drakeford said: “We are committed to supporting period dignity and maintaining our investment in schools to help bring period poverty to an end.
“In March, we declared free sanitary products would be available to all women in Wales’s hospitals – it is only just that the same happens across our schools.
“It is essential ample sanitary products, as well as good facilities, are available to all female learners so they can manage their periods with confidence and remove what is an unnecessary barrier to their education.”
Welsh education minister Kirsty Williams said: “It’s unthinkable that young women could be forced to miss days of their education simply because they can’t access or afford period products.
“We’re committed to tackling this inequality in Wales and this funding will help make period products available to learners in all schools, free of charge and in the most dignified way possible.”
The grant money will be made available through local authorities, with schools encouraged to support “reusable, environmentally sustainable products”.
Research from humanitarian organisation Plan International shows 15 per cent of girls in the UK struggle to afford sanitary products, 14 per cent have had to borrow from their friends and almost 20 per cent have had to use a less suitable product due to cost.
Chancellor Philip Hammond announced in March’s spring statement that the government would fund a scheme to provide free sanitary products in secondary schools in England from September this year.
This follows an NHS pledge to make tampons and sanitary towels available to patients on request from summer this year.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies