Beam position uncertainties along the beam trajectory arise from the accelerator, beamline, and scanning magnets (SMs). They can be monitored in real time, e.g., through strip ionization chambers (ICs), and treatments can be paused if needed. Delivery is more reliable and accurate if the beam position is projected from monitored nozzle parameters to the isocenter, allowing for accurate online corrections to be performed. Beam position projection algorithms are also used in post-delivery log file analyses. In this paper, we investigate the four potential algorithms that can be applied to all pencil beam scanning (PBS) nozzles. For some combinations of nozzle configurations and algorithms, however, the projection uses beam properties determined offline (e.g., through beam tuning or technical commissioning). The best algorithm minimizes either the total uncertainty (i.e., offline and online) or the total offline uncertainty in the projection. Four beam position algorithms are analyzed (A1-A4). Two nozzle lengths are used as examples: a large nozzle (1.5 m length) and a small nozzle (0.4 m length). Three nozzle configurations are considered: IC after SM, IC before SM, and ICs on both sides. Default uncertainties are selected for ion chamber measurements, nozzle entrance beam position and angle, and scanning magnet angle. The results for other uncertainties can be determined by scaling these results or repeating the error propagation. We show the propagation of errors from two locations and the SM angle to the isocenter for all the algorithms. The best choice of algorithm depends on the nozzle length and is A1 and A3 for the large and small nozzles, respectively. If the total offline uncertainty is to be minimized (a better choice if the offline uncertainty is not stable), the best choice of algorithm changes to A1 for the small nozzle for some hardware configurations. Reducing the nozzle length can help to reduce the gantry size and make proton therapy more accessible. This work is important for designing smaller nozzles and, consequently, smaller gantries. This work is also important for log file analyses.