Sash windows, or counter-balanced vertically sliding windows, are a common feature in domestic buildings. We describe a model for the ventilation flow rate through a sash window, when the indoor temperature is warmer than outdoors. Depending on the position of the neutral pressure level relative to the sash window, we identify three flow regimes and the critical height of the lower opening for the flow to transition from one regime to another. We perform laboratory experiments in a water tank to measure the flow rate for different sash window geometries, and compare our experimental results with the model. Using our results we assess the optimal sash window arrangement for different natural ventilation strategies. Our results have implications for optimal ventilation rates and control of ventilation in smart buildings.