This paper reviews current debates in social epistemology about the relations between knowledge and consensus. These relations are philosophically interesting on their own, but also have practical consequences, as consensus takes an increasingly significant role in informing public decision making. The paper addresses the following questions. When is a consensus attributable to an epistemic community? Under what conditions may we legitimately infer that a consensual view is knowledge-based or otherwise epistemically justified? Should consensus be the aim of scientific inquiry, and if so, what kind of consensus? How should dissent be handled? It is argued that a legitimate inference that a theory is correct from the fact that there is a scientific consensus on it requires taking into consideration both cognitive properties of the theory as well as social properties of the consensus. The last section of the paper reviews computational models of consensus formation.