The thickness dependences of the electrical conduction and the onset of superconductivity have been studied in ultrathin films of Bi, Pb, and Al. Thickness was varied by repeated in situ deposition of small increments of material onto amorphous Ge substrates held at low temperatures in an ultrahigh-vacuum environment. The thinner films of the resultant sequences of films were insulating and as thickness increased with successive depositions, superconductivity eventually appeared. This insulator-to-superconductor transition has been interpreted as a quantum phase transition, and compared in its features with predictions of the boson Hubbard model. The conductances of the sequences of films were scaled with a single parameter, and a universal scaling function was found. The scaling parameter vanished as the transition was approached from either the insulating or the superconducting side, falling as a power law of the difference between the Boltzmann conductance and a critical value of the conductance very close to (h/4e2)-1, or the inverse of the quantum resistance for pairs. The asymptotic value of the scaling function was also close to (h/4e2)-1, although this value was achieved only for Bi films. In the case of Pb and Al films superconductivity nucleated before the asymptotic limit was reached, at lower values of the conductance.