Recommended · for beginners
How Rotary Encoder Works and How To Use It with Arduino
Why people recommend it
A visual explanation of quadrature encoders, showing why comparing the two output signals reveals direction and why counts exceed the number of teeth.
Watch for: The direction logic can confuse first-timers
In their words
Here visualization shows why there will be more counts per revolution than number of tooth -
AlStorm Prime on electronics.stackexchange.com, Jul 2018. CC BY-SA.