The ban will see junk food make way for healthier options, such as fruit and sugar-free drinks.
Machines will instead have to contain food that is healthy, kind to teeth and safe to eat under orders handed down by Assembly Health Minister Edwina Hart, making Wales the first country in Britain to bring the measure into force. Reminders about eating five daily portions of fruit and vegetables should replace branding for sweets and chocolates on the side of machines.
An Abertawe Bro Morgannwg University NHS Trust spokeswoman said a range of healthy items would be put in place in its machines.
"The healthy items will include sandwiches, baked crisps, health fruit bars, water and mixed fruit.