Background: Cone-beam CT (CBCT) with non-circular scanning orbits can improve image quality for 3D intraoperative image guidance. However, geometric calibration of such scans can be challenging. Existing methods typically require a prior image, specialized phantoms, presumed repeatable orbits, or long computation time., Purpose: We propose a novel fully automatic online geometric calibration algorithm that does not require prior knowledge of fiducial configuration. The algorithm is fast, accurate, and can accommodate arbitrary scanning orbits and fiducial configurations., Methods: The algorithm uses an automatic initialization process to eliminate human intervention in fiducial localization and an iterative refinement process to ensure robustness and accuracy. We provide a detailed explanation and implementation of the proposed algorithm. Physical experiments on a lab test bench and a clinical robotic C-arm scanner were conducted to evaluate spatial resolution performance and robustness under realistic constraints., Results: Qualitative and quantitative results from the physical experiments demonstrate high accuracy, efficiency, and robustness of the proposed method. The spatial resolution performance matched that of our existing benchmark method, which used a 3D-2D registration-based geometric calibration algorithm., Conclusions: We have demonstrated an automatic online geometric calibration method that delivers high spatial resolution and robustness performance. This methodology enables arbitrary scan trajectories and should facilitate translation of such acquisition methods in a clinical setting., (© 2024 American Association of Physicists in Medicine.)