The average structure of double-walled carbon nanotube ͑DWCNT͒ samples can be determined by x-ray diffraction ͑XRD͒. We present a formalism that allows XRD patterns of DWCNTs to be simulated and we give researchers the tools needed to perform these calculations themselves. Simulations of XRD patterns within this formalism are compared to experimental data obtained on two different DWCNT samples, produced by chemical vapor deposition or by peapod conversion ͑i.e., high-temperature peapod annealing͒. For each sample, we are able to determine structural aspects such as the number of walls, the diameter distribution of inner and outer tubes, the intertube spacing, and the bundled structure.