Purpose: Respiratory gated CT planning and treatment has been used to reduce widened margins that accounts for motion‐induced uncertainties. This study evaluates the residual tumor motion within the gating window of gated CT scans and associated margin. Method and Materials: Gated CT data were acquired in 24 patients (23 lung cancer, 1 liver cancer) at the end‐of‐expiration and at the end‐of‐inspiration on a PQ5000 CT simulator with a commercial gating system. Three moving spherical phantoms were also used to simulate tumor motions at 2–4 sec/cycle. Gated CT data at the end‐of‐expiration was used for treatment planning for gated intensity modulated radiotherapy (IMRT) or three‐dimensional conformal radiotherapy (3DCRT). Residual target motion within the gating window was determined using target motion determined from the CT pairs, recorded surrogate marker motion at the end‐of‐expiration and end‐of‐inspiration. Results: Phantom study suggests that breathing cycle should be > 2 sec/cycle to avoid image artifacts induced by residual motion. A minimum 3 sec/cycle breathing period is required for patients undergoing gated CT in our institution. In the patient study, most tumors moved in the superior‐inferior direction ranging from 3mm to 17mm. The residual target motion within the gating window ranged 0.6mm to 3.4mm. Based on a mean positioning error of 3.0 mm for gated treatment reported in the literature, a margin of 6.0mm to 9.0mm (within 2σ of independent Gaussian distributions) was required to account for both daily positioning error and residual tumor motion in gated IMRT and 3DCRT, corresponding to an additional margin of 0.1 mm to 3.1 mm comparing to that without accounting for residual tumor motion. Conclusion: Residual tumor motion within the gating window should not be ignored. Additional margin accounting for residual can be estimated from gated CT data and applied to gated treatment. © 2005, American Association of Physicists in Medicine. All rights reserved.