In the present study, a novel computational method to optimize window design for thermal comfort in naturally ventilated buildings is described. The methodology is demonstrated by means of a prototype case, which corresponds to a single-room, rural-type building. Initially, the airflow in and around the building is simulated using a Computational Fluid Dynamics model. Local climate data are recorded by a weather station and the prevailing conditions are imposed in the CFD model as inlet boundary conditions. The produced airflow patterns are utilized to predict thermal comfort indices, i.e. the PMV and its modifications for non-air-conditioned buildings, with respect to various occupant activities. Mean values of these indices (output/objective variables) within the occupied zone are calculated for different window-to-door configurations and building directions (input/design variables), to generate a database of input–output data pairs. The database is then used to train and validate Radial Basis Function Artificial Neural Network (RBF ANN) input–output “meta-models”. The produced meta-models are used to formulate an optimization problem, which takes into account thermal comfort constraints recommended by design guidelines. It is concluded that the proposed methodology provides the optimal window designs, which correspond to the best objective variables for both single and several activity levels.