WELCOME TO MY DIGITAL GARDEN & TECHNICAL ARCHIVE READ MORE →
> lens-calculator-v2.exe

Parameters

mm
m
m

History

    What's new in v2 #

    This is the same distance formula as the original Lens Calculator — subject width, sensor width, distance and focal length, know three and it finds the fourth — but the sensor and lens fields now work off a proper gear list instead of raw numbers:

    • Camera is picked from a list. Each camera carries its sensor width and its lens mount (E-mount, EF, MFT, LPL, B4...).
    • Focal length can still be typed in manually in mm, but the lens icon next to the field opens a list of real lenses to pick from instead. Prime lenses fill in a single focal length; zoom lenses fill in a range.
    • The lens list is automatically filtered to lenses that fit the selected camera's mount — a Sony E-mount body won't be offered a B4 broadcast zoom, and vice versa.
    • When you calculate a focal length instead of picking one, the tool suggests lenses from the list that would actually cover it, again narrowed to whatever mount your selected camera uses.

    Tip: Pick a zoom lens for focal length and the calculator runs the formula at both ends of its zoom range, showing the result as a range — e.g. "Calculated distance: from 5.20m to 20.10m" — instead of a single number.

    Adding your own cameras and lenses

    Both lists live in one file: public/js/lens-calculator-v2/gear.json. It's a plain JSON file with two arrays:

    {
      "cameras": [
        { "id": "...", "label": "Sony FX6", "sublabel": "Full Frame · E-mount", "sensorWidth": 35.6, "mount": "E" }
      ],
      "lenses": [
        { "id": "...", "label": "Sony FE 24-70mm f/2.8 GM II", "mount": "E", "type": "zoom", "minFocalLength": 24, "maxFocalLength": 70 },
        { "id": "...", "label": "Sony FE 50mm f/1.2 GM", "mount": "E", "type": "prime", "focalLength": 50 }
      ]
    }

    A camera needs a sensorWidth (in mm) and a mount code. A lens needs a matching mount code and either focalLength (for a "type": "prime" lens) or minFocalLength/maxFocalLength (for a "type": "zoom" lens). The mount codes are just plain strings you make up — as long as a camera and a lens share the same one, the lens will show up as compatible. Add as many entries as you like; nothing else in the tool needs to change.