A taxi driver has been bashed in the head by hammer-wielding passenger in a terrifying attack in Melbourne's north-east.

The 37-year-old driver was taken to hospital after being hit with the hammer multiple times at Liberty Parade, Heidelberg, at about 1.45pm on Sunday.

Police believe the incident began with a dispute about fare evasion.

"The male got out of the taxi and smashed the windscreen with a hammer before opening the driver’s door and continuing to assault the driver," police said.

"The offender fled on foot and was last seen east along Morobe Street."