PURPOSE: To quantify the variability of diaphragm motion during free-breathing radiotherapy of lung patients and its effect on treatment margins to account for geometric uncertainties. METHODS AND MATERIALS: Thirty-three lung cancer patients were analyzed. Each patient had 5-19 cone-beam scans acquired during different treatment fractions. The craniocaudal position of the diaphragm dome on the same side as the tumor was tracked over 2 min in the projection images, because it is both easily visible and a suitable surrogate to study the variability of the tumor motion and its impact on treatment margins. Intra-acquisition, inter-acquisition, and inter-patient variability of the respiratory cycles were quantified separately, as were the probability density functions (PDFs) of the diaphragm position over each cycle, each acquisition, and each patient. Asymmetric margins were simulated using each patient PDF and compared to symmetric margins computed from a margin recipe. RESULTS: The peak-to-peak amplitude variability (1 SD) was 3.3 mm, 2.4 mm, and 6.1 mm for the intra-acquisition, inter-acquisition, and inter-patient variability, respectively. The average PDF of each cycle was similar to the sin(4) function but the PDF of each acquisition was closer to a skew-normal distribution because of the motion variability. Despite large interfraction baseline variability, the PDF of each patient was generally asymmetric with a longer end-inhale tail because the end-exhale position was more stable than the end-inhale position. The asymmetry of the PDF required asymmetric margins around the time-averaged position to account for the position uncertainty but the average difference was 1.0 mm (range, 0.0-4.4 mm) for a sharp penumbra and an idealized online setup correction protocol. CONCLUSION: The respiratory motion is more irregular during the fractions than between the fractions. The PDF of the respiratory motion is asymmetrically distributed. Both the intra-acquisition variability and the PDF asymmetry have a limited impact on dose distributions and inferred margins. The use of a margin recipe to account for respiratory motion with an estimate of the average motion amplitude was adequate in almost all patients.