The salary you must earn to be able to buy the median home in San Francisco is $125,071. That home costs $705,000 – up 24% from a year ago. San Francisco tops the list of the most unaffordable cities. Households earning the median income of $51,000, well, forget it.