Improving photon-number resolution of single-photon sensitive detectors is important for many applications, as is extending the range of such detectors. Here we seek improved resolution for a particular superconducting transition-edge sensor (TES) through better processing of the TES output waveforms. With that aim, two algorithms to extract number resolution from TES output waveforms are compared. The comparison is done by processing waveform data sets from a TES illuminated at nine illumination levels by a pulsed laser at 1550 nm. The algorithms are used to sort the individual output waveforms and then create clusters associated with individual photon numbers. The first uses a dot product with the waveform mean (for each illumination level), while the second uses K-means clustering modified to include knowledge of the Poisson distribution. The first algorithm is shown to distinguish adjacent peaks associated with photon numbers up to 19, whereas the second algorithm distinguishes photon numbers up to 23, using the same data.