Lens Focal Length Calculator
Calculate the required focal length from subject distance, sensor size, and desired framing. Enter values for instant results with step-by-step formulas.
Calculator
Adjust values & calculateFormula
The required focal length equals the sensor dimension (width or height in mm) multiplied by the distance to subject, divided by the subject dimension. Frame fill percentage adjusts the effective sensor dimension used in the calculation.
Last reviewed: December 2025
Worked Examples
Example 1: Full-Body Portrait at 5 Meters
Example 2: Filming a Car at 20 Meters on APS-C
Background & Theory
The Lens Focal Length Calculator applies the following established principles and formulas. Computers represent all information using binary, a base-2 number system consisting solely of the digits 0 and 1, each called a bit. Because long binary strings are unwieldy, programmers routinely use octal (base 8) and hexadecimal (base 16) as compact shorthand. Converting between bases follows a consistent algorithm: divide the source number repeatedly by the target base, collecting remainders in reverse order. Hexadecimal digits A through F represent the values 10 through 15, allowing a single character to encode four binary bits, making it the preferred notation for memory addresses, color codes, and bytecode. Bitwise operations manipulate individual bits within integers. AND produces a 1 only when both input bits are 1, making it useful for masking. OR produces a 1 when either bit is 1 and is used for combining flags. XOR flips bits that differ, enabling simple toggle logic and efficient swap algorithms. NOT inverts every bit (one's complement), while left and right shifts multiply or divide by powers of two in constant time. Data storage units ascend in binary multiples of 1024: 8 bits form one byte, 1024 bytes form one kibibyte (KiB), 1024 KiB form one mebibyte (MiB), and so forth. Hard-drive manufacturers historically use decimal prefixes (1 KB = 1000 bytes), creating the persistent confusion between binary and decimal interpretations of the same label. The IEC standardized the binary prefixes KiB, MiB, GiB, and TiB in 1998 to resolve this ambiguity. Network bandwidth is measured in bits per second (bps), most commonly megabits per second (Mbps) or gigabits per second (Gbps). A 100 Mbps connection transfers 100 million bits every second, equating to roughly 12.5 megabytes per second. IP subnet masks define network boundaries; CIDR notation appends a prefix length (e.g., /24) to an address, indicating how many leading bits are fixed. A /24 subnet contains 256 addresses with 254 usable hosts. Algorithm efficiency is described using Big-O notation, which characterises the worst-case growth of time or space relative to input size. O(1) is constant, O(log n) is logarithmic (binary search), O(n) is linear, and O(nยฒ) is quadratic. Cryptographic hash functions like SHA-256 produce a fixed 256-bit (32-byte) digest regardless of input length. File compression algorithms exploit statistical redundancy to reduce storage footprint, and compression ratio equals the original file size divided by the compressed size.
History
The history behind the Lens Focal Length Calculator traces back through the following developments. The conceptual foundation of modern computing traces back to Charles Babbage, whose Analytical Engine design of 1837 introduced the idea of a general-purpose mechanical computer with separate storage and processing units, including what he called the Store and the Mill. Ada Lovelace wrote what many consider the first algorithm intended for machine execution while annotating a translation of Luigi Menabrea's account of Babbage's work, also recognising the machine's potential to manipulate symbols beyond mere numbers. George Boole published "The Laws of Thought" in 1854, formalising a two-valued algebra of logic that would later map perfectly to electrical circuits. It remained largely a mathematical curiosity until Claude Shannon's landmark 1937 master's thesis demonstrated that Boolean algebra could describe switching circuits, laying the theoretical groundwork for all digital electronics. Shannon's 1948 paper "A Mathematical Theory of Communication" defined the bit as the fundamental unit of information and established information theory as a rigorous discipline. The same year, the transistor was invented at Bell Labs by Bardeen, Brattain, and Shockley, eventually replacing vacuum tubes and enabling miniaturisation at scale. ENIAC, completed in 1945, was one of the first general-purpose electronic computers, occupying 1800 square feet and consuming 150 kilowatts of power while performing roughly 5000 additions per second. The ASCII standard was ratified in 1963, assigning 7-bit codes to 128 characters and enabling interoperability between computers from different manufacturers. Through the 1970s, the microprocessor consolidated an entire CPU onto a single chip; Intel's 4004 in 1971 marked the beginning of this trend. The Apple II launched in 1977 and the IBM PC in 1981 brought computing to homes and offices, triggering a mass-market software industry. Tim Berners-Lee proposed the World Wide Web in 1989 and launched the first website in 1991 at CERN, transforming the internet from an academic and military network into a global information infrastructure. Mobile computing accelerated through the 2000s with smartphones integrating powerful processors, wireless networking, and GPS into pocket-sized devices, extending computation into every facet of daily life and cementing TCP/IP as the universal communications fabric.
Frequently Asked Questions
Formula
Focal Length = (Sensor Dimension x Distance) / Subject Size
The required focal length equals the sensor dimension (width or height in mm) multiplied by the distance to subject, divided by the subject dimension. Frame fill percentage adjusts the effective sensor dimension used in the calculation.
Worked Examples
Example 1: Full-Body Portrait at 5 Meters
Problem: You want to photograph a 1.8m tall person standing 5 meters away, filling 80% of the frame vertically on a full-frame camera (36x24mm sensor).
Solution: Desired image height = 24mm x 0.80 = 19.2mm\nSubject distance = 5,000mm\nSubject height = 1,800mm\nFocal length = (19.2 x 5,000) / 1,800 = 53.3mm\nNearest common lens = 50mm\nHorizontal FOV = 2 x atan(36 / (2 x 53.3)) = 37.3 degrees\nCrop factor = 1.00 (full frame)
Result: Required: 53.3mm | Nearest lens: 50mm | FOV: 37.3 degrees horizontal
Example 2: Filming a Car at 20 Meters on APS-C
Problem: Film a 4.5m long car from 20 meters away, filling 70% of the horizontal frame on an APS-C camera (23.5 x 15.6mm sensor).
Solution: Desired image width = 23.5mm x 0.70 = 16.45mm\nSubject distance = 20,000mm\nSubject width = 4,500mm\nFocal length = (16.45 x 20,000) / 4,500 = 73.1mm\nCrop factor = 1.53\nFull-frame equivalent = 73.1 x 1.53 = 111.8mm\nNearest common lens = 70-200mm zoom at ~73mm
Result: Required: 73.1mm (111.8mm FF equiv) | Use 70-200mm zoom at 73mm
Frequently Asked Questions
What is focal length and how does it affect my image?
Focal length is the distance in millimeters between the optical center of a lens and the camera sensor when the lens is focused at infinity. It determines two key properties: magnification and angle of view. Shorter focal lengths (wide-angle lenses like 14mm to 35mm) capture a wider field of view, making subjects appear smaller but including more of the scene. Longer focal lengths (telephoto lenses like 85mm to 600mm) narrow the field of view and magnify distant subjects. Focal length also affects perspective rendering: wide lenses exaggerate the apparent distance between near and far objects, while telephoto lenses compress perspective, making objects at different distances appear closer together. This is why portraits typically use 85mm to 135mm lenses to produce flattering facial proportions.
What is crop factor and how does it change effective focal length?
Crop factor, also called focal length multiplier, describes how a camera sensor size compares to a full-frame 35mm sensor (36mm x 24mm). A smaller sensor captures a narrower portion of the image circle projected by the lens, producing a tighter crop that mimics a longer focal length. APS-C sensors have a crop factor of 1.5x (Nikon, Sony) or 1.6x (Canon), so a 50mm lens produces framing equivalent to a 75mm or 80mm lens on full-frame. Micro Four Thirds sensors have a 2.0x crop factor, making a 25mm lens equivalent to 50mm. The actual focal length does not change, but the field of view and magnification match the equivalent full-frame focal length. This affects lens selection: a 35mm lens on APS-C gives normal perspective similar to 50mm on full-frame.
How do I choose the right focal length for portraits?
Portrait focal length selection depends on the type of portrait and desired background compression. For tight headshots, 85mm to 135mm on full-frame is ideal, providing natural facial proportions without geometric distortion. The longer the focal length, the more the background is compressed and blurred, which isolates the subject effectively. For environmental portraits showing the subject in context, 35mm to 50mm works well, though you must be careful not to get too close with wide lenses as they distort facial features. Half-body and three-quarter portraits work beautifully at 50mm to 85mm. Group portraits benefit from 35mm to 50mm to include everyone without requiring excessive distance from the group. Wide-angle lenses below 35mm should generally be avoided for portraits as they elongate noses and distort features near the frame edges.
What is the relationship between focal length and depth of field?
Longer focal lengths produce shallower depth of field at the same aperture and subject distance, which is why telephoto lenses are prized for their ability to blur backgrounds. However, this relationship is nuanced. If you maintain the same subject magnification (same framing) while changing focal length, you must also change your distance to the subject, which partially offsets the depth of field change. A 200mm lens at f/2.8 from 10 meters and a 100mm lens at f/2.8 from 5 meters producing the same framing will have nearly identical depth of field. The practical difference is that the 200mm lens compresses the background more, making the out-of-focus areas appear larger and smoother. For maximum background blur, use the longest focal length available at the widest aperture while maintaining your desired framing.
How does sensor size affect the focal length I need?
Sensor size directly determines the focal length required to achieve a specific field of view and framing. A full-frame camera with a 50mm lens captures the same field of view as an APS-C camera with a 33mm lens or a Micro Four Thirds camera with a 25mm lens. When planning a shoot, you must factor in your camera sensor size to select the appropriate lens. This is especially important when following focal length recommendations from tutorials or guides that may assume full-frame cameras. The sensor width and height determine how much of the lens image circle is captured. Larger sensors also provide shallower depth of field at equivalent fields of view, which is why medium format cameras produce such distinctive shallow-focus images even at moderate apertures.
What focal length should I use for landscape photography?
Landscape photography most commonly uses focal lengths between 14mm and 35mm on full-frame cameras, though compelling landscapes can be created at any focal length. Ultra-wide lenses (14mm to 20mm) are popular for expansive vistas with dramatic foreground elements, as they exaggerate the sense of depth and scale. Standard wide-angle (24mm to 35mm) provides a natural field of view that closely matches human perception while still including a broad scene. Telephoto landscapes at 70mm to 200mm are underutilized but create stunning images by isolating specific features, compressing layers of mountains or dunes, and eliminating distracting elements. Many professional landscape photographers carry a 16-35mm wide zoom and a 70-200mm telephoto to cover both approaches and switch between expansive and compressed perspectives.
References
Reviewed by Daniel Agrici, Founder & Lead Developer ยท Editorial policy