Why 6-Bit Code my lenses?

Every digital Leica M since the M8 reads six small marks on the lens mount. Those marks tell the camera which lens is fitted. Code an uncoded lens and the camera starts recognising it, applying the right corrections and writing the lens name into every file.

This page covers what the code does, how to read it, and the codes themselves. There are 52 lenses listed, with suggested codes for third-party glass alongside each Leica equivalent.

What the camera does with the code

  • Lens data in EXIF. Lens name and focal length are written into every file, so you can filter by lens in Lightroom instead of guessing months later.
  • Automatic lens corrections. The camera applies the correction profile for that lens, handling vignetting, chromatic aberration and distortion. Cleaner JPEGs and less work on RAWs.
  • Correct image stabilisation on the SL2 and SL3. With an M adapter, the body needs to know the focal length to stabilise properly. An uncoded lens leaves it guessing.

That last one is the reason most SL2 and SL3 owners end up coding their lenses. It is not a nicety. Stabilisation calculated for the wrong focal length works against you.

Which cameras read it

Every digital M from the M8 onwards, including the M8, M9, M-E, M Monochrom, M240, M262, M10 family, M11 family and the Pixii. Also the SL2 and SL3 when you are using M glass on an adapter.

Film bodies ignore the code entirely, so there is nothing to gain from coding a lens you only use on an M6 or an MP. No harm either, if you share lenses between film and digital.

How the code works

Six positions sit in a shallow arc on the lens bayonet flange. Read them clockwise from twelve o'clock, positions one through six. Black is a one, white is a zero. Codes can start with either, so 010000 on the Tri-Elmar 16-18-21mm is as valid as 100000.

Six positions gives sixty-four possible patterns in total, and a few lenses share one. The Summilux-M 35mm f/1.4 Steel rim and the Thambar-M 90mm f/2.2 both read 001100. The camera still tells them apart, because the code is not the only thing it reads. The position of the frame selector lever, which every M lens sets according to its focal length, is combined with the six bits to identify the lens.

Coding a lens yourself

The marks are just paint. There is no chip, no contact and nothing electronic. A black mark absorbs the light from the camera's reader, a white one reflects it. Which means you can apply a code with a pen, change it whenever you like, and remove it completely with a cotton bud and a little isopropyl alcohol.

The practical difficulty is not the paint, it is the placement. The pits are small, close together, and sit on a curved surface you cannot easily see while you work. Free-handing it usually ends in a smudge across two positions. That is the problem our M-Coder Kit solves: it clips onto the flange and holds the pen over the right pit, so a code takes around twenty seconds instead of a careful ten minutes.

If your lens has a screw sitting where a mark should go, fill the recess with white first, then either leave it or mark over it in black depending on what the code needs.

If your lens is not listed

Third-party lenses code to the closest Leica equivalent. Match the focal length first and the maximum aperture second, since the correction profile is built mostly around the optical design at that focal length.

When you are unsure between two candidates, put the camera on a tripod and shoot the same scene with each code. Look at the corners at the widest aperture, where vignetting and colour shift are most visible. The right code is usually obvious side by side. Working through a few lenses this way takes about twenty minutes.

The codes

Black is 1, white is 0. Read clockwise from twelve o'clock.

Lens 6-bit code Third-party equivalents
Wide and ultra-wide
Tri-Elmar-M16-18-21mm f/4 ASPH 010000 Zeiss Distagon T* 2.8/15 ZM
Voigtländer 12mm f/5.6 Ultra Wide-Heliar
Voigtländer 15mm f/4.5 Super Wide-Heliar (at 16mm)
Super-Elmar-M18mm f/3.8 ASPH 110100 Zeiss Distagon T* 4/18 ZM
21mm
Elmarit-M21mm f/2.8 000001 Konica M-Hexanon 21-35mm f/3.4-4.0 (21mm only)
Voigtländer 21mm f/1.8 Ultron
Zeiss Distagon T* 2.8/21 ZM (older)
Elmarit-M21mm f/2.8 ASPH 011000 Voigtländer 21mm f/3.5 Color Skopar
Voigtländer 21mm f/4 Color Skopar
Zeiss Biogon T* 2.8/21 ZM
Kobalux 21mm f/2.8
7Artisans 21mm f/1.5
Super-Elmar-M21mm f/3.4 110011 No suggestions yet
Summilux-M21mm f/1.4 ASPH 101111 TTArtisan 21mm f/1.5
Voigtländer 21mm f/1.4 Nokton
24mm
Elmar-M24mm f/3.8 ASPH 110010 Voigtländer 25mm f/4 Snapshot Skopar
Elmarit-M24mm f/2.8 ASPH 011001 Zeiss Biogon T* 2.8/25 ZM (with mount fix)
Voigtländer 28mm f/2.8 Color Skopar
Summilux-M24mm f/1.4 ASPH 110000 No suggestions yet
28mm
Tri-Elmar-M28-35-50mm f/4 ASPH 101010 No suggestions yet
Summaron-M28mm f/5.6 001011 Voigtländer 28mm f/5.6 Color Skopar
Elmarit-M28mm f/2.8 (III) 000011 No suggestions yet
Elmarit-M28mm f/2.8 (IV) 011011 No suggestions yet
Elmarit-M28mm f/2.8 ASPH (I & II) 011100 Zeiss Biogon T* 2.8/28 ZM
Konica M-Hexanon 28mm f/2.8
Voigtländer 28mm f/2 Ultron (older)
Summicron-M28mm f/2 ASPH (I, II & III) 011010 Voigtländer 28mm f/2 Ultron II
Voigtländer 28mm f/2 Ultron (older versions)
Voigtländer 28mm f/1.9 Ultron
Voigtländer 28mm f/3.5 Color Skopar
Zeiss Biogon T* 2.8/25 ZM
Summilux-M28mm f/1.4 ASPH 110110 Voigtländer 28mm f/1.5 Nokton
Thypoch Simera 28mm f/1.4
7Artisans 28mm f/1.4
35mm
Summarit-M35mm f/2.4 010001 Voigtländer 35mm f/2.5 Color Skopar (alt.)
Summarit-M35mm f/2.5 101011 Voigtländer 35mm f/2.5 Color Skopar
Summicron-M35mm f/2 (IV) 000110 Zeiss Biogon T* 2/35 ZM
Minolta M-Rokkor 40mm f/2
Voigtländer 40mm f/2 Heliar
Summicron-M35mm f/2 ASPH (I & II) 011110 Zeiss C Biogon T* 2.8/35 ZM
Voigtländer 35mm f/1.7 Ultron
Voigtländer 35mm f/2 APO Lanthar
Zeiss Distagon T* 1.4/35 ZM
Light Lens Lab 35mm f/2
APO-Summicron-M35mm f/2 ASPH 001101 No suggestions yet
Summilux-M35mm f/1.4 ASPH (incl. FLE I & II) 011101 Voigtländer 35mm f/1.2 Nokton III
Voigtländer 40mm f/1.4 Nokton
Voigtländer 40mm f/1.2 Nokton
Thypoch Simera 35mm f/1.4
TTArtisan 35mm f/1.4
7Artisans 35mm f/1.4
Summilux-M35mm f/1.4 Steel rim 001100 Shares a code with the Thambar-M 90mm f/2.2
50mm
Elmar-M50mm f/2.8 100010 Voigtländer 50mm f/3.5 Heliar
Summarit-M50mm f/2.4 010010 Voigtländer 50mm f/2.5 Color Skopar (alt.)
Summarit-M50mm f/2.5 101100 Voigtländer 50mm f/2.5 Color Skopar
Summicron-M50mm f/2 (III) 010111 Konica M-Hexanon 50mm f/2
Summicron-M50mm f/2 (IV & V) 100001 Zeiss Planar T* 2/50 ZM
Voigtländer 50mm f/2 APO Lanthar (older)
TTArtisan 50mm f/2
APO-Summicron-M50mm f/2 ASPH 101001 Voigtländer 50mm f/2 APO Lanthar (current)
Voigtländer 50mm f/2 Ultron
Summilux-M50mm f/1.4 (II) 000101 Summarit 5cm f/1.5
TTArtisan 50mm f/1.4
Summilux-M50mm f/1.4 ASPH (I & II) 100000 Voigtländer 50mm f/1.5 Nokton
Voigtländer 50mm f/1.2 Nokton ASPH
Zeiss C Sonnar T* 1.5/50 ZM
Thypoch Simera 50mm f/1.4
7Artisans 50mm f/1.1
Noctilux-M50mm f/1 011111 Voigtländer 50mm f/1.0 Nokton
TTArtisan 50mm f/0.95
7Artisans 50mm f/0.95
Noctilux-M50mm f/1.2 ASPH 001110 No suggestions yet
Noctilux-M50mm f/0.95 ASPH 110001 No suggestions yet
75mm
Summarit-M75mm f/2.4 010011 Voigtländer 75mm f/2.5 Color Heliar (alt.)
Summarit-M75mm f/2.5 101101 Voigtländer 75mm f/2.5 Color Heliar
Voigtländer 75mm f/1.9 Ultron (try 100100 as well)
APO-Summicron-M75mm f/2 ASPH 100100 Voigtländer 75mm f/1.9 Ultron (alt.)
Summilux-M75mm f/1.4 100011 Voigtländer 75mm f/1.5 Nokton
Thypoch Simera 75mm f/1.4
Noctilux-M75mm f/1.25 111010 7Artisans 75mm f/1.25
90mm and macro
Tele-Elmarit-M90mm f/2.8 (II) 000100 Konica M-Hexanon 90mm f/2.8
Elmarit-M90mm f/2.8 100110 Zeiss Tele-Tessar T* 4/85 ZM
Voigtländer 90mm f/2.8 APO Skopar
Summarit-M90mm f/2.4 010100 No suggestions yet
Summarit-M90mm f/2.5 101110 No suggestions yet
Summicron-M90mm f/2 (II) 000111 No suggestions yet
APO-Summicron-M90mm f/2 ASPH 100101 Voigtländer 90mm f/2.8 APO Skopar (alt.)
Summilux-M90mm f/1.5 111011 No suggestions yet
Thambar-M90mm f/2.2 001100 Shares a code with the Summilux-M 35mm f/1.4 Steel rim
Macro-Elmar-M90mm f/4 100111 No suggestions yet
Macro-Adapter-M14409 101000 No suggestions yet
Macro-Adapter-M14652 111001 No suggestions yet
135mm
Elmarit-M135mm f/2.8 (I & II) 001001 Voigtländer 125mm f/2.5 APO Lanthar
APO-Telyt-M135mm f/3.4 110101 No suggestions yet

Third-party suggestions are community sourced and some experimentation may be needed to find the best match for your particular copy. The lens code table originates from lavidaleica.com, compiled by Carsten Whimster with contributions from Sean Reid, Jan Dvorak, Dante Stella and others in the Leica community. The full community table is at tinyurl.com/6bitcodes.

Code your own lenses

The M-Coder Kit holds the pen in the right place so you can code, re-code and clean off any M-mount lens in about twenty seconds. Designed and made in the UK.

See the M-Coder Kit