A Sydney student has faced court after scanning cashews and pistachios as bags of bananas at a self-service checkout.

Stefan Toth, 24, was caught during a random bag check at Coles World Square in the Sydney CBD in January.

His receipt said he had purchased four bunches of bananas, but a guard found one bunch plus a bag of raw cashews, some roasted pistachios and a pack of Tassal salmon.

Downing Centre Local Court on Wednesday was told the part-time metal worker offered to pay the difference.

But the three items were seized and police called.

File image of Coles’ trolleys. Credit: Joel Carrett / AAPIMAGE

Toth said he must have made a mistake when scanning.

But that raised the eyebrows of police who saw he had managed to correctly scan brown onions, snacking tomatoes, four-leaf salad mix, dairy cheese and a tub of Philadelphia cream cheese.

More on 7NEWS.com.au

Toth pleaded guilty to fraud, apologised to the court and explained he had been intoxicated when taking the three items worth $28.95.

“At end of the day, you picked high-value items,” magistrate Jacqueline Trad said on Wednesday.

“If you can work it out, you weren’t that drunk.

“If you can’t afford the cashews, don’t try to buy them as bananas.”

Toth was given a one-year conditional release order without conviction.