San Francisco is home to many great coffee shops and cafes. It really depends on what you are looking for. Here are some of my favorites:
Bluebottle Coffee Company (local chain)
This is a very "hip" local chain that serves some unique items, such as "Louisiana Style" chicory iced coffee -- this is a personal favorite, and not something you will find at a national chain. They also have some very tasty pastries and snacks available.
Tartine (local, single location)
Located in a very interesting part of the Mission district, Tartine offers first-class pastries, including huckleberry frangipane tarts, delicious homemade croques, wine and great coffee. There is always a line out the door during the day.
La Boulange (local chain)
La Boulange is a local, French-style bakery and cafe. While not quite up to Paris standards, this place is pretty good, and offers large Cafe Au Lait in a bowl, and a multitude of locally-baked pastries and breads.