Rates are set by the city of San Francisco: the Taxi Meters will show the same amount regardless which Taxi Company picks up your fare: $3.50 when you step foot in the cab, $2.50 per mile, $2.50 per minute waiting or traffic delay - and there is an airport surcharge of $2.0 if you are coming from SFO into the city.
A typical fare within city limits will set you back $15 on average.
A typical ride to/from SFO will cost you $40 to $50. If you are going to the Oakland airport (OAK), plan for a $75 ride. Drivers may collect fare in advance for trips out of SFO and Oakland Airport, and there is a $2.0 airport surcharge out of SFO.
All San Francisco Taxis are required to accept major credit cards, which might save you yet a trip to the ATM, Yay!
Outside of the downtown area and other districts with large tourist populations (North Beach, Pier 39), don't count on flagging down a cab, this is not New York. Get the Taxi Mojo App on your iPhone / Android instead, and save yourself a nice chunk of your precious time!