Aircraft wings are commonly designed with nonplanar geometry, such as winglets, in order to improve aerodynamic efficiency. This work presents a method for generating nonplanar wing designs through gradient-based optimization, which is then used to investigate the performance characteristics of nonplanar wings. The nonplanar parameterization is defined to give a large design space that allows the formation of highly nonplanar features and permits large changes to the geometry. Aerodynamic characteristics are captured using an inviscid three-dimensional panel method with approximations for viscous drag. The methodology is demonstrated by optimizing reference wings from literature and comparing aerodynamic performance. Investigations are also performed on the impact on performance when wings are raised or drooped, and the differences in aerodynamic behavior between the two designs. Results suggest that the converged designs and their performance are highly dependent on how the geometry is restricted. If a large design space is provided, both raised and drooped wings are able to produce designs with similar performance when only inviscid analysis is considered. When accounting for viscous effects, results suggest that drooped wings are not beneficial for drag reduction.