In the late stages of phase separation in liquids or solids with negligible coherency stresses, the structure function S(k,t) is known to follow a scaling behavior in the form S(k,t)\ensuremath{\sim}${\mathit{k}}_{\mathit{m}}^{\mathrm{\ensuremath{-}}3}$(t)F(k/${\mathit{k}}_{\mathit{m}}$(t)), where ${\mathit{k}}_{\mathit{m}}$(t) is the value of k that maximizes S at a given t. Previous work has shown that, for many real systems and for three-dimensional computer models, the scaling function F(x) depends only on the volume fraction \ensuremath{\varphi} of the minority phase but not on the temperature T for a given \ensuremath{\varphi}. Results from a Monte Carlo simulation of the two-dimensional Ising model, and also from a recently published numerical solution of the two-dimensional Cahn-Hilliard equation, are shown here to give a scaling function that can be fitted, as in the three-dimensional case, by an analytical expression containing just one adjustable parameter \ensuremath{\gamma}\ifmmode \tilde{}\else \~{}\fi{}, independent of T but dependent on \ensuremath{\varphi}. We analyze and interpret some universal features of these scaling functions, including their behavior at small x and at large x, and their dependence on \ensuremath{\varphi}. Our discussion is based on a two-phase model, i.e., a mixture of two types of domains separated by thin interfaces, with kinetics based on the Cahn-Hilliard equation. We introduce an assumption of self-similar evolution (in the sense of self-similar probability ensembles) and show that it leads to the well-known ${\mathit{t}}^{1/3}$ growth rate for the average domain size and to the above-mentioned universal properties of the scaling function. Simple geometric considerations also allow the calculation of the parameter \ensuremath{\gamma}\ifmmode \tilde{}\else \~{}\fi{}, so that the scaling function may be obtained without any adjustment of parameters. The influence of droplet-size distributions on the scaling function, the limit of very dilute alloys, and the temperature dependence of the coarsening rate are also considered.