Abstract Conservation of energy and fault tolerance are two major issues in the deployment of a wireless sensor network (WSN). Design of clustering and routing algorithms for a large scale WSN should incorporate both these issues for the long run operation of the network. In this paper, we propose distributed clustering and routing algorithms jointly referred as DFCR. The algorithm is shown to be energy efficient and fault tolerant. The DFCR uses a distributed run time recovery of the sensor nodes due to sudden failure of the cluster heads (CHs). It takes care of the sensor nodes which have no CH within their communication range. We perform extensive experiments on the proposed algorithm using various network scenarios. The experimental results are compared with the existing algorithms to demonstrate the strength of the algorithm in terms of various performance metrics.