The design of Low Power Wide Area Network (LPWAN) protocols has attracted increasing attention in recent years, particularly within the LoRa research community. However, NB-IoT, another critical LPWAN technology, has not seen similar growth in its research community due to the lack of a functional and flexible software-defined radio (SDR) implementation. To address this gap, we present SoftNB, the first fully functional physical layer SDR implementation for NB-IoT. SoftNB conforms to the latest 3GPP standards and features an efficient and effective signal processing pipeline to mitigate time, frequency, and phase offsets during transmission and reception. Additionally, SoftNB is compatible with various SDR platforms, including USRP, HackRF One, and RTL-SDR Dongle. Extensive evaluations of SoftNB demonstrate its superior performance. Compared to the state-of-the-art baseline, SoftNB achieves an$8\times$reduction in Block Error Rate (BLER) when the number of repetitions is set to 4 at a distance of 450 meters.