In this paper, we present a polynomial chaos-based framework for the trajectory optimization of an overhead crane system under uncertainty. The main research described in this paper is as follows. First, the deterministic trajectory optimization problem formulation of a two-dimensional overhead crane model is constructed. Based on this basic mathematical formulation, the uncertainty trajectory optimization problem is formed considering the uncertainty of initial state and system parameter. Then, to solve the uncertainty trajectory optimization problem efficiently, a robust trajectory optimization problem formulation is proposed. However, it is difficult to solve the robust trajectory optimization problem directly because it contains stochastic function terms, such as stochastic dynamic equations, constraint functions and objective functions. We consider both the system state and control input as functions of uncertainty and use polynomial chaos expansion to quantify these stochastic functions. An augmented deterministic trajectory optimization problem which can be solved directly is finally obtained. Based on the proposed robust trajectory optimization formation, the motion trajectory optimization of an overhead crane system under two different uncertainty types of is solved. All simulation results are compared with traditional sampling-based Monte Carlo simulations to demonstrate the feasibility and effectiveness of the proposed method.