This paper presents the planning of a near-optimum path and location of a workpiece by genetic algorithms. The purpose of this planning is to minimize the processing time required for a robot to complete its work on a workpiece. The location of the workpiece can be anywhere by translating it along any direction and by rotating it about the fixed z-axis of the robot coordinate system. Owing to the changeable location of the workpiece and the alterable motion time required for a robot to move between two workpoints, the path and location planning problem is much more complicated than the travelling salesman problem. It is definitely impossible to obtain an optimum path and location within an acceptable time. In this paper, genetic algorithms are applied to solve this problem. The location of the workpiece is defined by three position parameters and one angular parameter, and the path is determined based on the values of the parameters for all workpoints. All the path and location parameters are encoded into a binary string. They are modified simultaneously by genetic algorithms to search for a global solution. As the workpiece can be anywhere, a penalty function is used to prevent the selection of illegal paths. Two experiments are given to show the performance of genetic algorithms: one has 30 workpoints and the other has 50 workpoints. Compared with four human-generated plannings, planning by genetic algorithms has much better performance in minimizing the processing time.