An efficient variational method to solve the two‐dimensional Schrödinger equation using a basis set of cubic $B$ splines is introduced. The method, which uses the effective mass theory and the envelope function approximation, is applied to find the energy levels of quantum‐well wires of different shapes. Finally, for rectangular wires a very simple method based on a special decomposition of the $V(x,y)$ potential is used to reduce the problem to two one‐dimensional equations. This gives very good results even for very narrow wires, where the conventional decomposition $V(x,y) = V(x) + V(y)$ fails.