This paper explores a novel stochastic optimal control method to determine conflict-free 4D (3D space and time) trajectories by considering uncertainties during flight. 4D trajectory management is a necessary concept to meet future growth in air traffic. However, aircraft may deviate from its planned 4D trajectory due to uncertainties during flight, and a conflict between aircraft can occur and lead to severe consequences. First, a probabilistic conflict detection algorithm by using the computationally efficient generalized polynomial chaos method is proposed. Conflict probability between aircraft is estimated by applying the conflict detection algorithm. In addition, a numerical algorithm incorporating the generalized polynomial chaos into the pseudospectral method is proposed to solve stochastic optimal control problems. The proposed stochastic trajectory optimization method combining the conflict detection algorithm is applied to the conflict resolution problem and generate optimal conflict-free trajectories. Through the numerical simulations for the three-dimensional conflict resolution problem between multiple heterogeneous aircraft, the performance and effectiveness of the proposed algorithm are evaluated and verified.