Your rear drivetrain is defined by two things: how many sprockets the cassette has (the «speeds»: 8, 9, 10, 11 or 12) and which freehub body they mount on. The freehub is the cylinder on the wheel where the cassette engages, and there are four types that are not interchangeable: HG, Microspline, XD and XDR. To know what fits your bike you need those two answers: speed count and freehub type.
Swapping a cassette sounds simple until the new one won't fit your wheel. The shortcut: identify your speeds and your freehub, and you'll know exactly what to buy.
First, the speeds: count the cassette sprockets or check your shifter (it usually says 11s, 12s). Second, the freehub: HG is the classic splined type and takes a minimum 11-tooth cog; Microspline and XD/XDR are modern and take a 10-tooth cog for wider ranges. The chain must match the speed count. If cassette, chain and freehub don't speak the same language, it won't shift right or simply won't fit.
A cassette only fits its freehub: a Microspline one (Shimano 12-speed) will never mount on an HG or XD body, even though both are «12-speed». The good news: many hubs let you swap just the freehub body to migrate standards. Before buying, confirm your freehub and your speeds.
If you're unsure which cassette, freehub or chain fits your bike, send us the case. Real diagnosis, nothing to sell you. Message us on WhatsApp
Count the cassette sprockets, or check your shifter: it usually reads 10s, 11s or 12s. Multiply by the chainrings for the total (2x11 = 22).
Look at the body the cassette mounts on: wide splines and an 11T small cog means HG. If the small cog is 10T, it's Microspline (Shimano) or XD/XDR (SRAM).
Only if your freehub, shifter and derailleur support it. Going 11- to 12-speed almost always means a new chain and, depending on brand, a new freehub.