A surfer who refers to himself as "shark bait" has been hospitalised after a shark attack during an early morning surf on the NSW mid-north coast.

The man received five deep lacerations to one of his lower legs when he was bitten by a shark at Nambucca Heads after 7am on Sunday, a NSW Ambulance spokesman said.

Joel Mason, 36, managed to swim to a nearby break wall, where a passer-by saw him and contacted emergency services.

He was treated at the scene before being flown to John Hunter Hospital in Newcastle, where he's in a stable condition.