We experimentally investigate behavior and beliefs in a sequential prisoner’s dilemma. Each subject had to choose an action as first-mover and a conditional action as second-mover. All subjects also had to state their beliefs about others’ second-mover choices. We find that subjects’ beliefs about others’ choices are fairly accurate on average. Using the elicited beliefs, we compare the explanatory power of a few current models of social and moral preferences. The data show clear differences in explanatory power between the preference models, both without and with control for the number of free parameters. The best-performing models explain about 80% of observed behavior. We use the estimated preference parameters to identify biases in subjects’ expectations. We find a consensus bias (whereby subjects believe others behave like themselves) and a certain optimism (whereby subjects overestimate probabilities for favorable outcomes), the former being about twice as strong as the second.