Purpose: The mask and couch in online CBCT images interferes in deformable image registration. We developed an automatic algorithm to remove the artifacts outside the patient skin surface. A comparison study was performed on CBCT images from 10 H&N cancer patients with and without skin detection. Method and Materials: A skin template is created based on the helical CT image and placed on the corresponding CBCT image based on the rigid body registration. An adaptive filter is applied to the region outside of the template. This filter is created utilizing two typical histograms of CBCT image, one representing background voxels, and the other representing tissue voxels. A threshold can be determined by searching the minimum between the two histograms and used to create the skin surface on the CBCT image. Finally, a cluster algorithm is applied to remove the isolated area located in the skin region. The auto skin detection algorithm was tested using 10 treatment CBCT data obtained from 10 Head and Neck cancer patients. Deformable image registrations were performed with and without skin removal to evaluate the effect of skin removal on the deformable image registration. Results: Results show that the average nearest distance between the auto skin and the hand‐drawn skin is 0.93mm; the average standard deviation is 1.08mm, the worst standard deviation among the 10 patients is less than 1.7mm. The CBCT images with/without mask had been processed by deformable image registration software, the results indicate that most image registrations have been improved. Conclusion: The skin test result shows that this algorithm works reliably and efficiently. The image registration result indicates that deformable image registration with skin removal is more robust and accurate. Conflict of Interest: Supported by Elekta research grant.