The aim of this work is to provide a systematic study on tiltrotor airfoil aerodynamic design based on high-fidelity computational fluid dynamics (CFD) analyses. It mainly involves two optimization problems. The first part is carried out to find an airfoil geometry which provides the maximum value of lift-to-drag ratio in high-speed airplane mode. The initial shape is a NACA 64A221 airfoil which is parameterized by Hicks-Henne functions. A novel mesh deformation algorithm based on inverse distance weighting (IDW) interpolation and transfinite interpolation (TFI) is presented for mesh generation. Numerical simulations are performed with the Reynolds-averaged Navier-Stokes equations supplemented with the Spalart-Allmaras turbulence model. By using NLPQL optimization algorithm, the lift-to-drag ratio of the optimal airfoil has been improved by 46.57% compared to the initial airfoil. On the basis of the optimized shape, the second part of this paper is conducted to design the trailing edge flap and find out the optimal flap deflection angle for minimum download force in helicopter mode. It is demonstrated that the optimal flap deflection angle is 65° and the download can be reduced by 44.47% regarding the undeflected flap case.