back to top

10 Best Cheap Prime Lenses in 2024 (For Canon, Nikon & More)

Last updated: January 18, 2024 - 17 min read
ExpertPhotography is supported by readers. Product links on ExpertPhotography are referral links. If you use one of these and buy something, we make a little money. Need more info? See how it all works here.
Subscribe Below to Download the Article Immediately

You can also select your interests for free access to our premium training:

Your privacy is safe! We will never share your information.

The best cheap prime lens gives you quality images without leaving you out of pocket. Lenses can be very expensive. And if you’re a professional photographer with a budget, that’s no problem. But for casual camera users, it might be.

Thankfully, we’ve made a list of all the best cheap prime lenses. The Canon EF 50mm f/1.8 is our top pick because it’s the perfect blend of value and performance. But we have a wide variety of lenses from all the major camera brands.

Our Top 3 Choices for The Best Cheap Primes Lens
Canon EF 50mm F/1.8 STM
Canon EF 50mm F/1.8 STM
Canon EF 50mm F/1.8 STM
Canon RF 50mm F/1.8 STM
Canon RF 50mm F/1.8 STM
Canon RF 50mm F/1.8 STM
Canon EF-S 24mm F/2.8 STM
Canon EF-S 24mm F/2.8 STM
Canon EF-S 24mm F/2.8 STM
 

What Is the Best Cheap Prime Lens?

The best cheap prime lens gives you a good deal without compromising image quality. But let’s be honest. There are bad lenses out there. And some of them are dirt cheap.

But going down that road only costs you more in the long run. So the lenses on our list are all great value. They cost less, but they are fantastic lenses too.

We’ve selected high-quality prime lenses from the best manufacturers. There are no questionable brands. And you can buy all the lenses on our list brand new. You’re not getting dodgy deals here.

Canon and Nikon have the most entries on our list. They are the most popular camera brands. And they offer good lenses at excellent prices.

We also have lenses from Sony, Panasonic, and Olympus. And we even have one from Pentax.

Here’s a quick rundown of our picks for the best cheap prime lenses. We go into more detail on each lens in the section after. And we answer some FAQs at the end of the article.

Our Top Choice
Canon EF 50mm F/1.8 STM
Canon EF 50mm F/1.8 STM
Canon EF 50mm F/1.8 STM
  • Excellent for portraits, action, and nighttime shots
  • Sharp images with beautiful background blur
  • Near-silent, quick focusing with STM technology
  • Compact size makes it a great everyday lens
  • Outstanding picture quality at an affordable price
Best Canon Mirrorless Lens
Canon RF 50mm F/1.8 STM
Canon RF 50mm F/1.8 STM
Canon RF 50mm F/1.8 STM
  • Compact, lightweight design perfect for EOS R cameras
  • Versatile for snapshots, portraits, landscapes, and more
  • Superior optical features for standout images
  • Large f/1.8 aperture for low-light and creative blur
  • Smooth, quiet auto-focus, ideal for video and photos
Best Canon Pancake Lens
Canon EF-S 24mm F/2.8 STM
Canon EF-S 24mm F/2.8 STM
Canon EF-S 24mm F/2.8 STM
  • Super lightweight and compact for easy travel
  • Advanced autofocus (AF) and superior optics
  • Silent and smooth focus tracking for seamless video
  • Full-time manual focus for precise control
  • Beautiful, soft background blur with 7-blade circular aperture
Best Nikon APS-C DSLR Lens
Nikon AF-S DX NIKKOR 35mm F/1.8G
Nikon AF-S DX NIKKOR 35mm F/1.8G
Nikon AF-S DX NIKKOR 35mm F/1.8G
  • Compact and lightweight for easy handling
  • Quiet AF operation for discreet shooting
  • Two focus modes for ultimate control
  • High reproduction capability for stunning picture quality
  • Ideal for low-light conditions and general photography
Best Full Frame DSLR Lens
Nikon AF-S NIKKOR 50mm F/1.8G
Nikon AF-S NIKKOR 50mm F/1.8G
Nikon AF-S NIKKOR 50mm F/1.8G
  • Exceptionally sharp edge-to-edge performance
  • Compact design ideal for on-the-go shooting
  • Fast and quiet autofocus with silent motor
  • Versatile 50mm focal length for various shots
  • Includes useful accessories and extended warranty
Best Nikon Mirrorless Lens
Nikon NIKKOR Z 40mm F/2
Nikon NIKKOR Z 40mm F/2
Nikon NIKKOR Z 40mm F/2
  • Compact and lightweight for easy travel
  • Versatile 40mm view for various shots
  • Fast, near-silent autofocus for seamless shooting
  • Custom control ring for personalized adjustments
  • Creates beautiful, natural bokeh effect
Best Sony Lens
Sony E 16mm F/2.8 SEL16F28
Sony E 16mm F/2.8 SEL16F28
Sony E 16mm F/2.8 SEL16F28
  • Compact, lightweight design for easy carry
  • Delivers smooth, quiet autofocus for quality shots
  • Enhances bokeh effect with circular aperture blades
  • Reduces spherical aberration with aspherical lens design
  • Compatible with optional ultra-wide and fisheye converters
Best Panasonic Lens
Panasonic Lumix DG 25mm f/1.7 ASPH
Panasonic Lumix DG 25mm f/1.7 ASPH
Panasonic Lumix DG 25mm f/1.7 ASPH
  • Natural viewing angle for various occasions
  • Large f/1.7 aperture for beautiful bokeh
  • Super lightweight and compact design
  • Hybrid photography with smooth focusing
  • Compatible with multiple camera models
Best Olympus Lens
Olympus ED 30mm f/3.5 Prime Lens for Micro 4/3
Olympus ED 30mm f/3.5 Prime Lens for Micro 4/3
Olympus ED 30mm f/3.5 Prime Lens for Micro 4/3
  • Exceptional macro lens for detailed, life-size shots
  • Enhances image quality via focus stacking with OM-D E-M1
  • Fast, quiet AF ideal for discreet photo and video capture
  • Compact and lightweight for travel convenience
  • Delivers sharp images with harmonious bokeh at f/3.5
Best Pentax Lens
smc Pentax-DA 40mm F/2.8 XS
smc Pentax-DA 40mm F/2.8 XS
smc Pentax-DA 40mm F/2.8 XS
  • Ultra-low profile design for portability
  • Crafted by renowned designer, Marc Newson
  • Equivalent to 61mm in 35mm format for versatility
  • Maximum f/2.8 aperture for creative depth of field
  • Pentax SP coating for lens element protection

10 Best Cheap Prime Lenses

Now we look at all the best cheap prime lenses in more detail. We have a good range of lenses to choose from. And we’ve covered all the major brands. You’ll definitely find a bargain in this list.

1. Canon EF 50mm f/1.8 STM

Canon EF 50mm F/1.8 STM
Brand
Brand
Canon
Lens Mount
Lens Mount
Canon EF
Maximum Aperture
Maximum Aperture
f/ 1.8
Focal Length Range
Focal Length Range
50 mm
Image Stabilization
Image Stabilization
No
Weight
Weight
0.35 lb / 159 g
Key Features
Key Features
STM AF, 35mm minimum focus distance
Best For
Best For
Canon DSLR users looking for an affordable and versatile prime lens

If you want value for money when shopping for lenses, look no further than the Canon EF 50mm f/1.8 STM. It delivers sharp and clear images. And it’s one of the cheapest lenses on this list.

With a versatile 50mm focal length, you can use it for anything from street photography to portraits. Its versatility and convenient size make it a good lens for travel photography.

It’s a compact, lightweight prime lens that fits inside any camera backpack. But despite the small size, the barrel contains six glass elements.

Each glass element has been shaped with care and precision. And the result is edge-to-edge sharpness on all your images. There’s very little distortion, even in direct sunlight!

The lens uses an STM rather than the USM autofocus (AF) motor. But the older STM motor still gives fast and smooth focusing.

Autofocus can also be used for Servo AF modes and video recording. So it’s good for vlogging.

The EF 50mm f/1.8 STM is a must-have for Canon DSLR users. It’s an absolute bargain and a handy addition to your lens collection!

 

2. Canon RF 50mm f/1.8 STM

Canon RF 50mm F/1.8 STM
Brand
Brand
Canon
Lens Mount
Lens Mount
Canon RF
Maximum Aperture
Maximum Aperture
f/ 1.8
Focal Length Range
Focal Length Range
50 mm
Image Stabilization
Image Stabilization
No
Weight
Weight
0.35 lb / 159 g
Key Features
Key Features
Custom control ring, glass coating, STM AF
Best For
Best For
Canon mirrorless users who want a simple and affordable prime lens

The RF 50mm f/1.8 STM is one of the cheapest lenses in Canon’s entire RF catalog. It is a simple lens with few bells and whistles. But there’s no compromise with optical quality. 

Mirrorless cameras are known for being lightweight. And adding this lens to the setup isn’t going to change that. It weighs only 0.35 lb (159 g). And it basically fits in your pocket!

With a 50mm focal length, the lens is the perfect nifty-fifty for your mirrorless machine. This lens lets you shoot landscapes, portraits, and candid street shots.

And the fast f/1.8 aperture gives you excellent exposure control. So it’s a good option for low-light situations. Plus, the glass engineering is top-notch, as you’d expect from Canon.

The Canon RF 50mm f/1.8 STM lens contains one aspherical element that reduces chromatic aberration. You also have a coating on the outer element that prevents lens flare.

It also uses the older STM gear-driven AF system. But the lens does use the 12-pin communication system for faster response times. This improves autofocus subject detection and tracking.

You can also customize the function of the lens’s control ring. It’s a surprising feature on a lens at this price. You can use it for manual focusing. Or you can switch it to control settings, like aperture or ISO.

 

3. Canon EF-S 24mm f/2.8 STM

Canon EF-S 24mm F/2.8 STM
Brand
Brand
Canon
Lens Mount
Lens Mount
Canon EF-S
Maximum Aperture
Maximum Aperture
f/ 2.8
Focal Length Range
Focal Length Range
24 mm
Image Stabilization
Image Stabilization
No
Weight
Weight
0.27 lb / 125 g
Key Features
Key Features
7-blade circular aperture, full-time manual focus, pancake design
Best For
Best For
Canon APS-C DSLR users looking for an ultra-compact lens

Prime lenses aren’t much more compact and lightweight than the EF-S 24mm f/2.8 STM. It has an ultra-slim pancake design. So it can slip into your pocket. But it still delivers pristine images.

The 24mm focal length gives you a lovely wide-angle view. It’s great for broad street and travel shots. It’s great as a landscape photography lens. And you can use it as an architecture or real estate lens.

The f/2.8 maximum aperture isn’t the fastest. But you still get excellent exposure control and a shallow depth of field. And the seven-blade circular aperture gives you a smooth bokeh effect in your images.

You get fast autofocus from the STM system. And you have full-time manual focus when shooting in One Shot AF mode on your camera. That gives you the best of both worlds.

The Canon EF-S 24mm f/2.8 STM doesn’t have many special features. Its main selling points are its wide angle and the pancake design. And the low, low price, of course!

You can check out our full list of the best pancake lenses.

 

4. Nikon AF-S DX 35mm f/1.8

Nikon AF-S DX NIKKOR 35mm F/1.8G
Brand
Brand
Nikon
Lens Mount
Lens Mount
Nikon F
Maximum Aperture
Maximum Aperture
f/ 1.8
Focal Length Range
Focal Length Range
35 mm
Image Stabilization
Image Stabilization
No
Weight
Weight
44 lb / 200 g
Key Features
Key Features
Manual focus override, SWM AF, 7-blade rounded aperture
Best For
Best For
Nikon APS-C DSLR users

If you have a Nikon APS-C DSLR, the AF-S DX 35mm f/1.8 is a must-have lens. It’s lightweight, compact, and super versatile. And it’s one of Nikon’s most affordable lenses.

With a 35mm focal length, it’s considered a standard-angle lens. And many travel and street photographers prefer the wider 35mm field of view compared to a 50mm lens.

A 35mm can capture narrower streets. And it’s easier to shoot building exteriors.

You might be surprised to learn this small lens contains eight glass elements. They are arranged in six groups. And its precision engineering gives you corner-to-corner sharpness.

The fast f/1.8 max aperture gives you excellent depth of field control. And you get a fantastic bokeh background thanks to the seven-blade rounded aperture diaphragm.

Nikon’s Silent Wave Motor (SWM) drives the autofocus system. It gives you fast and reliable focus with photo and video production. And it’s practically silent in operation. So it’s a good vlogging lens.

The Nikon AF-S DX 35mm f/1.8 is the definition of great value. You can buy it brand new from Nikon with a warranty. And it’s a versatile lens with thousands of uses. It’s definitely one to consider.

 

5. Nikon AF-S FX 50mm f/1.8

Nikon AF-S NIKKOR 50mm F/1.8G
Brand
Brand
Nikon
Lens Mount
Lens Mount
Nikon F
Maximum Aperture
Maximum Aperture
f/ 1.8
Focal Length Range
Focal Length Range
50 mm
Image Stabilization
Image Stabilization
No
Weight
Weight
0.4 lb / 185 g
Key Features
Key Features
SWM AF, Super Integrated Coating
Best For
Best For
Nikon full frame DLSR users

The AF-S FX 50mm f/1.8 is a super but inexpensive lens for Nikon full frame DSLRs. It’s a versatile piece of equipment. And it takes up next to no space in any camera bag.

As a 50mm lens, you get a wide range of shooting options. You can use it for anything from portraits to landscapes. And it’s a fabulous lens for high-quality street photography.

The wide aperture range gives you excellent control over both exposure and depth of field. Using the max f/1.8 aperture allows you to get a fabulous background blur.

It has one aspherical lens that prevents aberration and distortion. And the outer glass elements have Nikon’s Super Integrated Coating (SIC). This reduces lens flare and ghosting in strong light.

Nikon’s SWM gives you fast and quiet autofocusing. And this Nikon prime lens is compatible with the focusing mode that allows you to switch between auto and manual.

In this mode, you can switch back to manual by turning the control ring. You don’t need to change the settings in the camera.

Despite being simple and affordable, the Nikon AF-S FX 50mm f/1.8 delivers everything it promises. It isn’t flashy or overstated. But it is simple, subtle, and sophisticated.

 

6. Nikon Z 40mm f/2.0

Nikon NIKKOR Z 40mm F/2
Brand
Brand
Nikon
Lens Mount
Lens Mount
Nikon Z
Maximum Aperture
Maximum Aperture
f/ 2.0
Focal Length Range
Focal Length Range
40 mm
Image Stabilization
Image Stabilization
No
Weight
Weight
0.75 lb / 340 g
Key Features
Key Features
Custom control ring, 9-blade aperture, dust- and splash-resistant
Best For
Best For
Full frame or APS-C Nikon mirrorless users

The Z 40mm f/2.0 is a fabulous little lens for Nikon mirrorless cameras. It’s compact, lightweight, robust, and affordable.

It’s compatible with both APS-C and full frame Nikon cameras. And it’s a great place to start if you’re building a mirrorless lens arsenal.

With a full frame Nikon Z-series camera, it has a 40mm focal length, as advertised. But if you use it on an APS-C model, you get a 60mm focal length thanks to the crop factor. 

The f/2 max aperture gives you freedom with your exposure settings. And the lens is equipped with a high-torque stepping motor for the autofocus. So it’s super fast and responsive.

The autofocus is also practically silent. And it reduces focus from breaking, which is great news for filmmakers. 

The customizable front control ring is another handy feature. You can use it for manual focusing. But you can also set it to adjust ISO, aperture, or exposure compensation for a more personal touch. 

The Nikon Z 40mm f/2.0 is also a durable lens you can use outdoors. It’s dust-resistant for very dry conditions. And it is splash-resistant and protected against light rain.

It isn’t fully waterproof. So you must be careful in really bad weather. But it’s tough for a lens in this price range.

 

7. Sony E 16mm f/2.8

Sony E 16mm F/2.8 SEL16F28
Brand
Brand
Sony
Lens Mount
Lens Mount
Sony E
Maximum Aperture
Maximum Aperture
f/ 2.8
Focal Length Range
Focal Length Range
16 mm
Image Stabilization
Image Stabilization
No
Weight
Weight
0.18 lb / 84 g
Key Features
Key Features
Circular aperture, aspherical element, internal focus system
Best For
Best For
Sony APS-C users that want an ultra-compact lens

The E 16mm f/2.8 is a wafer-thin pancake lens for Sony APS-C cameras, like the popular a6600. The optics are fantastic for such a small lens. And it’s one of Sony’s most affordable lenses.

The lens has a 16mm focal length. But as it’s compatible with APS-C cameras, the effective focal length is actually 35mm. That makes it a standard wide-angle Sony lens.

It’s ideal for street and travel photography. But you can shoot landscapes and cityscapes. And it’s also good for group portraits.

The f/2.8 max aperture isn’t ultra-fast. But it still gives you good low-light performance and lets you control the depth of field. You can achieve a good bokeh background with its faster apertures.

An aspherical element improves optical quality by reducing distortion and aberrations. The Sony E 16mm f/2.8‘s image quality is really sharp, even at the outer edges.

Fast and smooth focusing helps you get better results with photography and video. And the internal focus system lets the lens keep its compact shape when refocusing. It doesn’t expand or contract.

 

8. Panasonic Lumix G 25mm f/1.7

Panasonic Lumix DG 25mm f/1.7 ASPH
Brand
Brand
Panasonic LUMIX
Maximum Aperture
Maximum Aperture
f/ 1.7
Focal Length Range
Focal Length Range
25 mm
Image Stabilization
Image Stabilization
No
Weight
Weight
0.35 lb / 158 g
Key Features
Key Features
Two aspherical elements, hybrid lens, stepping motor for AF
Best For
Best For
Multimedia producers that use Micro Four Thirds cameras

The Lumix G 25mm f/1.7 is one of the best-value lenses in Panasonic’s catalog. The 25mm focal length is equivalent to 50mm on a full frame camera.

This means you get a standard-angle field of view, making it an ideal lens for street photography and travel photography. But it’s also great for portraits with a wider composition.

It has eight glass elements in seven groups. So this Pansonic lens delivers clarity and sharpness.

Two of those elements are aspherical, reducing chromatic aberration. And the outer glass has a nano surface coating that eliminates glare and flare.

It’s also optimized for photography and video making. That’s no surprise when you look at the hybrid features of Olympus and Panasonic cameras.

The AF is driven by a stepping motor, which is quick yet quiet. You can refocus while shooting without ruining the take.

And one of the best things about this lens is that it’s compatible with all Micro Four Thirds (MFT) cameras. Whether it’s a Panasonic or Olympus camera, this lens will fit.

 

9. Olympus ED 30mm f/3.5

Olympus ED 30mm f/3.5 Prime Lens for Micro 4/3
Brand
Brand
Olympus
Maximum Aperture
Maximum Aperture
f/ 3.5
Focal Length Range
Focal Length Range
30 mm
Image Stabilization
Image Stabilization
No
Weight
Weight
0.28 lb / 128 g
Key Features
Key Features
Movie &
Best For
Best For
Olympus users looking for an affordable prime

The ED 30mm f/3.5 is a great lens for Olympus users. It’s inexpensive as well as compact and lightweight, just like Olympus cameras.

As a Micro Four Thirds lens, it’s compatible with MFT cameras from Olympus and Panasonic. So you can mix and match lenses and bodies. That’s why this lens is worth having in your collection.

The 30mm focal length is equivalent to a 60mm lens on a full frame camera. This gives it more magnification and a tighter framing.

You can still use the Olympus ED 30mm f/3.5 for street and travel photography. But it’s also an ideal lens for more intimate portraits with a tighter composition.

Multimedia producers appreciate this lens. The silent stepping motor is optimized for taking photos and video recording. So there’s no noise to disturb the shot and practically no focus breathing.

 

10. Pentax DA 40mm f/2.8

smc Pentax-DA 40mm F/2.8 XS
Brand
Brand
Pentax
Lens Mount
Lens Mount
Pentax K
Maximum Aperture
Maximum Aperture
f/ 2.8
Focal Length Range
Focal Length Range
40 mm
Image Stabilization
Image Stabilization
No
Weight
Weight
0.09 lb / 45 g
Key Features
Key Features
SP coating, ultra-slim design
Best For
Best For
Pentax users who need a pancake prime lens

Pancake lenses are known to be slim. But the Pentax DA 40mm f/2.8 takes it to a whole new level.

Its ultra-slim design makes it the smallest lens on our list. Thankfully the number it’s priced at is equally as small. And yet, it still produces sharp images.

It’s compatible with Pentax K-series cameras, like the Pentax K-70. And it has a versatile 40mm focal length. You can use it for landscape, street, travel, and portrait photography.

The optical quality is excellent for such a small lens. And the special coating on the outer element reduces lens flare and ghosting. You get crisp and clear shots even in rough lighting conditions.

The autofocus motor is tiny, as you might expect in a lens this size. But it’s faster than you’d think. It’s quick and responsive. And there’s barely any noise.

The DA 40mm f/2.8 is a highly proficient and efficient lens. Would you expect anything less from Pentax? You can also check out our list of the best Pentax lenses we recommend.

 

Cheap Prime Lenses FAQs

With so many lenses to choose from, finding the right one isn’t easy. And that’s especially true if you’re on a budget. We hope our answers to these questions will help you find the perfect cheap prime lens.

Prime vs Zoom: Which Lens is Best For You?

Prime lenses and zoom lenses both have their pros and cons. That means deciding between the two depends on what you need.

Prime lenses have a fixed focal length, meaning they can not zoom in or out. That makes them less versatile and flexible than zoom lenses.

But with fewer moving parts, prime lenses often have superior optical quality. And zoom lenses are prone to distortion and aberrations, particularly around the edges.

Prime lenses don’t suffer from these problems. Even a budget prime lens gives you edge-to-edge sharpness. That’s why many photographers still shoot exclusively with prime lenses.

Are Prime Lenses Cheaper than Zoom Lenses?

Prime lenses are often cheaper than zoom lenses. Of course, pro-level prime lenses are more expensive than beginner zoom lenses. But in the same user category, primes are often cheaper.

Zoom lenses use more glass elements and have more moving parts. So the extra components and complexity mean they cost more to produce. And that means the price is higher for the consumer.

But that’s not to say you can’t find good-value zoom lenses. There are plenty of bargains in the zoom lens market.

 

 

Which Brands Make the Cheapest Prime Lenses?

As we’ve seen, many top camera brands have affordable prime lenses. Nikon and Canon have excellent lenses that also have a reasonable price tag.

The cheapest options tend to be for their older DSLR models. But both brands have cheap prime lenses for their mirrorless cameras too. We list both the best Canon RF lenses and Nikon Z lenses.

Olympus and Panasonic have a few cheap options. And the good thing with Micro Four Thirds lenses is that they all have the same lens mount. So these lenses can be used with all MFT cameras.

Sony’s cheapest options are their E-mount lenses for their APS-C cameras. The Sony FE lens range for their full frame cameras is incredible.

Sony has fantastic lenses for all types of photography. But they are high-grade pieces of equipment with expensive price tags to match.

As you may have noticed, Fujifilm is the biggest name missing from our list. They have been making stunning lenses for generations.

Fujifilm lens prices aren’t exorbitant. But there was nothing we could define as “cheap.” But you can see all the best Fujifilm lenses we recommend and decide for yourself!

Can You Use DSLR Lenses with Mirrorless Cameras?

With Canon and Nikon cameras, it is possible to use DSLR lenses with mirrorless cameras. But you need the appropriate lens adapter.

Nikon users need the Nikon FTZ II lens mount adapter. This lets you use your Nikon F-mount lenses with your new Nikon Z mirrorless camera.

If you have a Canon mirrorless camera, you need the EF to EOS R lens mount adapter. This accessory lets you use all your old EF lenses with your new Canon EOS R camera. 

A lens adapter is a fantastic accessory if you already have a big DSLR lens collection. It’s a small investment that can save you heaps of cash. And you don’t have to replace your entire lens collection!

 

Conclusion: The Best Cheap Prime Lens

Photography should be for everyone, even those on a tight budget. Equipment can be expensive. But thankfully, there are some cheap prime lenses out there.

The options we selected are affordable. But they still deliver when it comes to taking pictures! And the best cheap prime lens on our list is the Canon EF 50mm f/1.8 STM.

It’s compact, lightweight, and versatile. It’s ideal for street and travel photographers. And the lens’s fast aperture gives you excellent exposure control. It’s also an absolute steal at such a low price!

Our Top 3 Choices for The Best Cheap Primes Lens
Canon EF 50mm F/1.8 STM
Canon EF 50mm F/1.8 STM
Canon EF 50mm F/1.8 STM
Canon RF 50mm F/1.8 STM
Canon RF 50mm F/1.8 STM
Canon RF 50mm F/1.8 STM
Canon EF-S 24mm F/2.8 STM
Canon EF-S 24mm F/2.8 STM
Canon EF-S 24mm F/2.8 STM