Errors in analog-to-digital conversion (ADC) occur due to internal links or other electronic parts; faults that may occur during code conversion cannot be overlooked because signal digitalisation demands a large dynamic range and high resolution. This paper presents a new and accurate self-test method to compensate for one of the most effective errors of ADC because of its effect, which may result in a missing code, which is a differential nonlinear (DNL) of a 10-bit SAR-ADC. The proposed method includes three stages: DNL error modelling for nonideal system implementation, detection, and correction. To evaluate the proposed technique, sinusoidal and sawtooth signals are applied as analog inputs to the proposed system. Adaptivity, speed, and accuracy are the main motivations of this work, which provide high accuracy compared to other techniques, up to 9.6 ENOB and 59.2 SNR with sawtooth signal and 9.5 ENOB and 59.2 SNR with sinewave signals.