The Bénard–Marangoni convection is studied in a three-dimensional container with thermally insulated lateral walls and prescribed heat flux at lower boundary. The upper surface of the incompressible, viscous fluid is assumed to be flat with temperature dependent surface tension. A Galerkin–Tau method with odd and even trial functions satisfying all the essential boundary conditions except the natural boundary conditions at the free surface has been used to solve the problem. The critical Marangoni and Rayleigh numbers are determined for the onset of steady convection as a function of aspect ratios x 0 and y 0 for the cases of Bénard–Marangoni, pure Marangoni and pure Bénard convections. It is observed that critical parameters are decreasing with an increase in aspect ratios. The flow structures corresponding to the values of the critical parameters are presented in all the cases. It is observed that the critical parameters are higher for case with heat flux prescribed than those corresponding to the case with prescribed temperature. The critical Marangoni number for pure Marangoni convection is higher than critical Rayleigh number corresponding to pure Bénard convection for a given aspect ratio whereas the reverse was observed for two-dimensional infinite layer.