AbstractThe threshold for the onset of thermocapillary flow in a planar liquid layer heated from below is increased by a vertical magnetic field when the liquid is a good electric conductor. The magnetic damping effect is reduced when the induced eddy currents are blocked by insulating side walls. Neutral conditions for this specific Bénard–Marangoni stability problem with a vertical field and side walls are obtained numerically for three‐dimensional perturbations assumed periodic in one horizontal direction. The domain is bounded by a free‐slip wall at the bottom, a free surface at the top and two free‐slip lateral walls in the other horizontal direction. Buoyancy forces and surface deformations are neglected and a constant heat flux is imposed on the free surface. Upon increasing the magnetic induction, the least stable modes become localized near the side walls and the convective threshold increases at a lower rate than for the least stable bulk mode.