Hybrid pixel detectors are segmented devices used for X-ray detection that consist of a sensor attached to the readout electronics. Detectors working in single-photon counting mode process each incoming photon individually, have essentially infinite dynamic range, and by applying energy discrimination they provide noiseless imaging. To improve the resolution of the detector and allow operation with high-intensity photon fluxes, the pixel size is reduced. However, with decreasing pixel size, a charge sharing effect is more prominent. This leads to false event registration or omitting the event, and degradation of the energy resolution of the detector. Algorithms aiming at reducing the influence of charge sharing have already been implemented on-chip. However, the spatial resolution of the detector can be increased beyond the physical size of the pixel if the charge proportions collected by neighboring pixels are analyzed.The simulations show that charge cloud size referred to pixel size and noise are the key parameters that determine the accuracy of the subpixel algorithm. The article shows the concept of subpixel algorithm and the simulations for different detector parameters and approximation algorithms. The slanted-edge method was implemented to quantify the resolution of detectors consisting standard readout architecture. The chips were simulated and tested to verify the influence of different bias voltages, sensor materials, and thicknesses on charge sharing and as a consequence on the detector resolution. The simulated and measured edge spread functions were compared. The results show that the simulator can be used to describe the spatial resolution of the detectors, and can be used for further studies of the resolution of detectors with subpixel algorithm implemented.