Start with width and height
A 12 MP image around 4000 × 3000 pixels can support many web uses and common print sizes. Heavy cropping, very large output, or detailed commercial work can require more.
Pixel quality matters
Lens quality, focus, sensor noise, processing, and compression can matter more than a small difference in megapixels. Calculate the actual file rather than relying only on the camera’s advertised maximum.