A group of McDonald’s customers managed to hack their way to a free lunch.

Three friends in Australia discovered the trick, which can only be performed on a self-service machine, and shared it with Reddit on Sunday.

In a video uploaded by the group, one of the members is seen selecting a dollar hamburger on the chain’s self-service touchscreen. After selecting the hamburger, he proceeds to add 10 to his bag.

MCDONALD'S CUSTOMER MAKES 'MCPICKLE BURGER' A 'REALITY' AFTER APRIL FOOLS' DAY JOKE BACKLASH

After the 10 burgers have been selected, he removes the hamburger patty from each sandwich, which discounts $1.10 from the order. As the hamburgers themselves only cost $1, this leaves a $1 credit to the order.

The person filming then selects a $1 hamburger with the patty and adds that to his cart, leaving him with one free burger.

At the end of the stunt, the group picks up their bag and show off their free hamburger with a patty, as well as the 10 patty-less buns, served with ketchup and pickles.

Some on Reddit were surprised by the hack, but others felt the effort was not worth a $1 hamburger.

CLICK HERE TO GET THE FOX NEWS APP

“Ahaha this is gold,” one person commented.

“Gonna try this tomorrow for lunch,” one person claimed.

“I'm all for exploiting loopholes and sticking it to the man or whatever, but I'm not a fan of wasting food. I hope you're going to eat all those buns,” another wrote.

“At the end of the day though, you only wanted the real cheeseburger. That’s a lot of effort to save $1,” one person commented on the thread.

Others claimed the hack has been known about for a while.

“This has been ozbargained a long time ago, and people are already over it, and Macca's employees would have known for ages,” one person wrote.

FOLLOW US ON FACEBOOK FOR MORE FOX LIFESTYLE NEWS

“There was a thread about it yesterday,” another pointed out.

Though as the anonymous person who posted the video said in the status, you “probably don’t have long” before McDonald’s fixes the self-serve board to not give out free burgers.