In this study, a series of new concepts and improved genetic operators of a genetic algorithm (GA) was proposed and applied to solve mobile robot (MR) path planning problems in dynamic environments. The proposed method has two superiorities: fast convergence towards the global optimum and the feasibility of all solutions in the population. Path planning aims to provide an optimal path from a starting location to a target location, preventing collision or so-called obstacle avoidance. Although GAs have been widely used in optimization problems and can obtain good results, conventional GAs have some weaknesses in an obstacle environment, such as infeasible paths. The main ideas in this paper are visible space, matrix coding and new mutation operators. In order to demonstrate the superiority of this method, three different obstacle environments have been used and an experiment is conducted. This algorithm is effective in both static and dynamic environments.