The attack was reported at 1:24 a.m. at the intersection of Ellis and Taylor streets.
The victim was standing on the street corner when a suspect approached and struck him with the bat, according to police.
The victim was taken to San Francisco General Hospital with a concussion. His injuries are not considered to be life threatening, police said.
The suspect, described as a man in his early 20s, fled and had not been found as of today.
Anyone with information about the attack is encouraged to call the Police Department's anonymous tip line at (415) 575-4444 or send a tip by text message to TIP411.