Getting a good haircut at sea can be hard, but Royal Australian Navy personnel posted to a warship are still required to maintain high personal grooming standards even while underway.

So to fill that need and to raise money for charity, a sailor onboard HMAS Ballarat has picked up the role of ship's barber.

Able Seaman Electronics Technician Matthew Davidson aims to raise $1,000 for mental health awareness group, Beyond Blue, by charging his shipmates for haircuts during the frigate's return to HMAS Stirling, Western Australia, from Exercise RIMPAC in Hawaii.

"I have seen first hand the effects ignoring mental health issues can have on a person's health and wellbeing," Able Seaman Davidson said.

"My aim was simply to raise money for a worthwhile charity and let people know there is help available through organisations such as Beyond Blue."

Able Seaman Davidson recognised the need for a ship's barber soon after he started cutting his own hair onboard and the requests from his 170 shipmates began to roll in.

"I bought myself a grooming kit and set to work on transforming the ship's mezzanine deck into a barber shop," Able Seaman Davidson said.

To date, he has cut the hair of more than half the crew and raised $850.

With Ballarat not expected to reach Stirling until September, the $1,000 goal seems well in hand.

The second Navy ship to bear the name, Ballarat was the eighth Anzac class helicopter frigate built for the service.

Ballarat is a long-range frigate capable of air defence, surface and undersea warfare, surveillance, reconnaissance and interdiction.

She is currently returning from the world's largest international maritime exercise, Exercise Rim of the Pacific, where she successfully fired an evolved sea sparrow missile as part of a live fire exercise.

Twenty-six nations, more than 40 ships and submarines, more than 200 aircraft and 25,000 personnel participated in RIMPAC throughout July.