Localization is one of the most important factors highly desirable for the performance of Wireless Sensor Network (WSN). Localization can be stated as the estimation of the location of the sensor nodes in sensor network. In the applications of WSN, the data gathered at sink node will be meaningless without localization information of the nodes. Due to size and complexity factors of the localization problem, it can be formulated as an optimization problem and thus can be approached with optimization algorithms. In this paper, the nature inspired algorithms are used and analyzed for an optimal estimation of the location of sensor nodes. The performance of the nature inspired algorithms viz. Flower pollination algorithm (FPA), Firefly algorithm (FA), Grey Wolf Optimization (GWO) and Particle Swarm Optimization (PSO) for localization in WSN is analyzed in terms of localization accuracy, number of localized nodes and computing time. The comparative analysis has shown that FPA is more proficient in determining the coordinates of nodes by minimizing the localization error as compared to FA, PSO and GWO.