Bell inequalities have traditionally been used to demonstrate that quantum theory is nonlocal, in the sense that there exist correlations generated from composite quantum states that cannot be explained by means of local hidden variables. With the advent of device-independent quantum information processing, Bell inequalities have gained an additional role as certificates of relevant quantum properties. In this work we consider the problem of designing Bell inequalities that are tailored to detect the presence of maximally entangled states. We introduce a class of Bell inequalities valid for an arbitrary number of measurements and results, derive analytically their maximal violation and prove that it is attained by maximally entangled states. Our inequalities can therefore find an application in device-independent protocols requiring maximally entangled states.