Benzoic acid is weaker than formic acid because the phenyl has an overall releasing effect ( which is smaller than that of methyl group ). When the carboxyl group is directly attached to the nucleus ,the resonance effect (+R)overcomes the (-I) effect .This prevents to a large extent the lone pair on the O atom of the -OH group from entering into resonance with the -CO group. The result is smaller positive charge on the O atom of the -OH group and so proton release is more difficult than in formic acid. The fact that benzoic acid is stronger than acetic acid means [(-I)+R] < +I of the methyl group.