Perhaps you have a quad pack of op amps, are using only three, and need a single comparator. It might be tempting to use the remaining op amp as a comparator, after all, both have high gain, low offset, and high common-mode rejection. But it’s easier said than done, because a comparator and an op amp, although similar, are different devices. It is possible to create a comparator out of an op amp, but if your design must be robust, there’s a good amount of checking and experimentation to make sure your quad pack of op amps will have what it takes to make a sufficient comparator.
Comparators tell us which of its two inputs is at a higher potential through the comparator’s logic output, which can be TTL or CMOS compatible. Comparators make a rapid transition between the maximum and minimum voltage rails in output to indicate the status of the inputs. Op amps are not characterized for the purpose and do not make rapid transitions due to the need to recover from saturation. Op amps are designed to drive small loads, fundamentally operate as closed-loop systems with feedback, and are not meant to be driven to saturation. Comparators are designed to operate as open-loop systems, operate at high speed, and rapidly drive output as high or low logic even when comparators are overdriven.
Op amps, when used as comparators, cannot provide high speed response like a comparator. Furthermore, since few datasheets will state how long it will take to come out of saturation, you may need to experiment with the op amp to find out how long it takes. Additionally, the stability of an op amp when used as a comparator is in question. The op amp-as-comparator will have very high-open-loop gain, thus a little bit of positive feedback during transitions can push the op amp into oscillating. That little bit of positive feedback may be due to stray capacitance. You can minimize stray capacitance with careful layout as one option. At this point, op amps may not seem attractive when used as a comparator due to the considerations.
Having said all of this, if the caveats above simply don’t matter or you are willing to do the experimentation, you can use an op amp as a comparator with due diligence to operating parameters as they affect the overall outcome. If speed is not an issue (as the op amp hesitates on output while desaturating), then stability will still need to be investigated. At this point, you may find that it’s not worth it to try and use a left or op amp as a comparator. If the op amp-as-comparator’s function is not critical, you can get away with using the op amp but may want to check that the slew rate is adequate (rule of thumb .5V/µs or faster for modern op amps.) Older op amps (pre-2000) may go into phase inversion.[i] Clamping output with a Zener diode feedback circuit can help to prevent saturation on output.
For non-critical designs, that fourth op amp in the quad pack may be sufficient. Otherwise, it might not be worth the time or the effort to end up with a headache that can be solved with a proper comparator.
[i] Bryant, James. “Using Op Amps as Comparators.” Analog Devices Application Note – AN-849 (2011): 1-8. Web. 20 Nov. 2016.