The type of photography that you are planning to use is an important decision factor. Here we have evaluated the Canon 18-135mm F3.5-5.6 IS and the Canon 24mm F2.8 STM for their suitability to various photography scenarios:
Size and Weight Comparison
The size of a lens is a crucial factor to consider when comparing two lenses. Canon 18-135mm F3.5-5.6 IS is the longer of the two lenses at 96mm. The Canon 24mm F2.8 STM with a length of 23mm, is 73mm shorter. Besides being longer, the Canon 18-135mm F3.5-5.6 IS also has a larger diameter of 77mm compared to the Canon 24mm F2.8 STM's 68mm diameter.
ss
Below you can find a scaled side-by-side image of Canon 18-135mm F3.5-5.6 IS and Canon 24mm F2.8 STM to get a better idea of how their sizes compare in real life.
The weight of a lens is equally significant as its external dimensions, particularly if you intend to handhold your camera and lens combination for extended periods. Canon 24mm F2.8 STM weighs 125g, 75% (390g) lighter than the Canon 18-135mm F3.5-5.6 IS's weight of 515g.
Filter Threads
The Canon 18-135mm F3.5-5.6 IS has a filter size of 67mm whereas the Canon 24mm F2.8 STM has a 52mm diameter. Larger filters are generally more expensive than the smaller ones given all the other features are equal.
Below are links to the 67mm filters that we recommend you to consider for the Canon 18-135mm F3.5-5.6 IS:
And these are the 52mm filters that we recommend for the Canon 24mm F2.8 STM:
Lens Mounts
Both the Canon 18-135mm F3.5-5.6 IS and the Canon 24mm F2.8 STM has the same Canon EF-S lens mount. Some of the latest released cameras that are compatible with the Canon EF-S lenses are Canon T8i, Canon 90D and Canon SL3.
Canon 18-135mm F3.5-5.6 IS is also available in Canon EF-S mount.
Focal Range
Canon 18-135mm F3.5-5.6 IS has a focal range of 18-135mm and
7.5X zoom ratio which has an effective (full-frame 35mm equivalent) focal range of
28.8-216mm when used on a APS-C / DX format camera.
On the other hand, the Canon 24mm F2.8 STM is a prime lens with fixed focal lenght of 24mm which has an effective (full-frame 35mm equivalent) focal range of 38.4mm when used on a APS-C / DX format camera.