Obviously, what you think is a comfortable sleep is entirely subjective, and the hotel booking sites are all pretty good in narrowing down the choices for you. That doesn’t mean I can’t provide you with an opinion on the places I have stayed at.
If you are travelling on a budget or going for the hostel experience then the best place to stay you can find in San Francisco is the Adelaide Hostel. In fact, it’s one of the best hostels I’ve ever stayed at. I stayed there during my first ever trip in 2006 and I went back there on my San Francisco anniversary trip in 2016 and both times I had absolutely no complaints to make. It is located just around the corner of Union Square, you couldn’t be any more central if you tried. The staff was lovely and made me feel super welcome, basically accepting me as a part of the hostel’s close circle of friends. All the guests were friendly and open and I saw plenty of groups of strangers go out to explore the city together as friends after meeting in the hostel. The bonding happens in the kitchen/dining room area, although the living room area probably looks the most comfortable and cosy. The rooms I stayed in have been 6-bed lady dorms and both times I had no problems with my room mates, everyone seems to respect each other’s privacy and the noise levels have kept down on the dormitory floors. Seeing that the dining room is such a buzzing communal hob there is no need for any of the guests to start parties in their rooms. The hostel arranges community activities every day, e.g. movie nights, pizza nights and excursions to nearby attractions. The beds are pretty comfortable to sleep in, as far as hostel mattresses go the Adelaide provides standard but decent mattresses. There are plenty of bathrooms, some are shower rooms with toilets, some are just toilets, and they were all in pretty good shape when I stayed there.
Another hostel worth checking out is definitely the Orange Village Hostel. It is a lot bigger and able to host a lot more guests, so it is not as ‘we-are-family’ as the Adelaide, but it is still a really comfortable choice for someone who wants to spend a few budget nights in a bunk bed. There are all sorts of dorm choices, but I stayed in a 4-bed female dorm with private bathroom. The rooms and beds were clean and my roommates were lovely, quiet and respectful. When our bathroom times clashed (you know what I mean) there were some more bathrooms down the hallway, and it never felt like there were too many people and too few bathrooms. It is also located in central San Francisco with easy access to public transport and popular sights and shopping areas. The hotel does also arrange tours and social activities like pub-crawls.