NYC: "However, compared to other communities of similar population size, New York has a crime rate that is noticeably lower than the average. This means that for comparably sized cities all across America, New York is actually safer than most according to NeighborhoodScout's exclusive analysis of FBI crime data."
SF: "Importantly, when you compare San Francisco to other communities of similar population, then San Francisco crime rate (violent and property crimes combined) is quite a bit higher than average. Regardless of how San Francisco does relative to all communities in America of all sizes, when NeighborhoodScout compared it to communities of similar population size, its crime rate per thousand residents stands out as higher than most."
Edit: having lived in both (currently in NYC) I also want to point out the two cities are incredibly different in almost every way. It's really tough to compare data across the whole "city" between the two because of the differences in geography, population density & distribution, types of crime, history & expectations, and overall city governance.