The problem of trajectory planning and obstacle avoidance in redundant robots is addressed in this paper. Four variants of Particle Swarm Optimization (PSO) and a Differential Evolution (DE) algorithm are proposed to solve this problem. Simulation experiments on a 5 degree-of-freedom (DOF) robot manipulator in an environment with static obstacles are conducted. The manipulator is required to move from a start position to a goal position with minimum error while avoiding collision with the obstacles in the workspace. The performance of the proposed algorithms is compared with the results reported in the literature and the comparative results are presented. It is observed that qPSO-C performs better in free space and PSO-C performs better in environment with obstacles in terms of minimizing error average convergence time. The performance of DE improves when the number of obstacles increases. © Springer International Publishing Switzerland 2015.