This paper develops and evaluates a method for handling stress constraints in topology optimization. The stress constraints are used together with an objective function that minimizes mass or maximizes stiffness, and in addition, the traditional stiffness based formulation is discussed for comparison. We use a clustering technique, where stresses for several stress evaluation points are clustered into groups using a modified P-norm to decrease the number of stress constraints and thus the computational cost. We give a detailed description of the formulations and the sensitivity analysis. This is done in a general manner, so that different element types and 2D as well as 3D structures can be treated. However, we restrict the numerical examples to 2D structures with bilinear quadrilateral elements.The three formulations and different approaches to stress constraints are compared using two well known test examples in topology optimization: the L-shaped beam and the MBB-beam. In contrast to some other papers on stress constrained topology optimization, we find that our formulation gives topologies that are significantly different from traditionally optimized designs, in that it actually manage to avoid stress concentrations. It can therefore be used to generate conceptual designs for industrial applications.