Calculator · focus

Laser focus calculator & ramp test generator

See how a focused beam pinches to its smallest spot and spreads again, how much each CO2 lens or fiber f-theta lens gives you, and how far off focus the material can sit. Then make a ramp test file: tilt a board, burn one marked line, and read your real focus error off the board.

1Your laser and lens

Laser type
Glass-tube makers list about 2.5–6 mm at the tube; the beam widens on its way to the head. Fiber sources: about 6–8 mm after the collimator. The 7 mm default for CO2 is our own placeholder, not a maker value.
1 = a perfect beam. Assumed 1.2 for CO2 and 1.5 for fiber (a common fiber-source spec is “below 1.5”); enter your own if your source states it.

2Move the material

+ = surface closer to the lens than the focus. Drag the plate in the picture or use this slider.
Width is magnified many times more than height. Orange band = depth of focus. The circle on the right is the spot on the surface, to scale against the spot at focus.
Spot at focus
118µm
1/e² diameter
Depth of focus
1.71mm
±0.85 mm (2 × Rayleigh range)
Spot at this height
181µm
+1.0 mm from focus
Power density here
42%
of the density at focus
Depth of focus here is the range over which the spot stays within √2 of its smallest diameter. Some lens charts use looser definitions and print larger numbers.

Lenses side by side

1.5 in88 µm±0.48 mm2.0 in118 µm±0.85 mm2.5 in147 µm±1.33 mm4.0 in235 µm±3.41 mm

Same input beam, same scale. Tap a lens to use it.

3Ramp test: the board

Use something flat and stable: a stack of coins, a strip of known thickness. Measure it.
You focused on

4Ramp test: the line

Just enough to mark the material, as LightBurn advises for its Focus Test.
Read it off the board after the test; values between marks are fine.
Enter the mark where the line is thinnest.
Slope
2.87°
10.0 ÷ 200 mm
Marks along the line
10.0mm
apart, every 0.5 mm of height
Heights covered
−4.5 … +4.5mm
vs where you focused
Line length
180mm
from 10.0 to 189.8 mm on X
Preview of the file (top view). Shading = how wide the line should burn if the focus is where you set it — narrowest at 0.
Side view
Before you run it: this file moves a real laser. Run it on scrap at low power and stay with the machine with a fire extinguisher near. Make sure the head clears the raised end — the gap shrinks by the height you raised. The board must be at least 15 mm wide: the line, marks and numbers sit within 12 mm of its front edge. For G-code: check that GRBL laser mode is on ($32=1) and that $30 matches the S max above, frame the job first, and set the work origin X0 Y0 at the front corner of the low end of the board.

The SVG is drawn in millimetres for LightBurn or xTool Creative Space. Place the drawing so its leftmost line is 10.0 mm from the low end of the board and its lowest line 1.0 mm from the board’s front edge.

G-code

The formulas

Spot at focus (1/e² diameter): d₀ = 4 M² λ f ÷ (π D)
Rayleigh range: zR = π d₀² ÷ (4 M² λ) · depth of focus = 2 zR
Spot at distance z from focus: d(z) = d₀ √(1 + (z ÷ zR)²) · power density = (d₀ ÷ d)² of the density at focus
Ramp test: surface height at X = h × X ÷ √(L² − h²) · mark spacing = step × √(L² − h²) ÷ h

λ is the wavelength (10.6 µm for CO2, 1.064 µm for fiber), f the focal length, D the beam diameter at the lens and M² the beam quality (1 for a perfect Gaussian beam). These are the formulas Omni Calculator uses; with M² = 1 the spot formula matches Sintec Optronics’ 1.27 λ f ÷ D for an f-theta lens. Depth of focus is defined, as both sources do, as twice the Rayleigh range: the distance over which the spot stays within √2 of its smallest diameter. The ramp formula is similar triangles: a board of length L raised by h rises h over its horizontal run.

The formulas give an ideal spot. A Sandia study of focusing lenses on a CO2 laser found that measured spots grew well above the aberration-free prediction as the focal length got shorter, which it put down to spherical aberration. Diode lasers are left out: their spots are rectangular and the beam is not a single round Gaussian beam, so measure them with the ramp test.

CO2 lenses compared

LensOur spot · depth of focusSintec chartThunder Laser’s suggested use
1.5 in 38.1 mm0.09 mm · ±0.48 mm0.076 mm · ±1.91 mmFine engraving, small text, photos
2.0 in 50.8 mm0.12 mm · ±0.85 mm0.127 mm · ±2.54 mmGeneral engraving and cutting; the usual starting lens
2.5 in 63.5 mm0.15 mm · ±1.33 mm0.178 mm · ±3.81 mmCutting where more focus tolerance helps
4.0 in 101.6 mm0.24 mm · ±3.41 mm0.304 mm · ±5.06 mmThick or low-density material, roughly over 10 mm

Our columns assume a 7 mm beam at the lens and M² 1.2 — our own placeholder values, not maker figures; change them in the calculator. Sintec’s chart does not state its beam. It labels its depth-of-focus figures “+/-”, although its own text defines depth of focus as the full twice-Rayleigh range, and the figures are wider than the Rayleigh definition gives for the same spot, so compare the trend, not the exact numbers.

Fiber f-theta lenses

Galvo fiber lasers focus through an f-theta lens, named by focal length and marking field. Thunder Laser USA identifies the lenses on its Aurora fiber laser as F160, F210 and F290 for the 110, 150 and 200 mm fields. A longer lens covers a bigger field with a bigger spot and a deeper focus:

LensFieldOur spot · depth of focus
F160110 × 110 mm46 µm · ±1.06 mm
F210150 × 150 mm61 µm · ±1.83 mm
F290200 × 200 mm84 µm · ±3.49 mm

Assumes a 7 mm beam and M² 1.5 (a common spec for 20 W pulsed fiber sources is M² below 1.5 and a 6–8 mm beam). Other makers sell 150 × 150 mm lenses at 210 or 225 mm, so read the focal length printed on your lens.

How to run the ramp test

  1. Take a flat scrap board 150–300 mm long and at least 15 mm wide (the line, marks and numbers sit within 12 mm of its front edge). Measure its length and the height of whatever you slip under one end — 5 to 12 mm is typical. Make sure the head clears the high end.
  2. Focus the way you normally do, on the spot you choose in the generator (the middle is best: it measures errors both ways).
  3. Download the SVG or the G-code. In LightBurn or xTool Creative Space, use the SVG; place the drawing so its leftmost and lowest lines sit the stated distances from the low end and the front edge. With G-code, set the work origin X0 Y0 at the front corner of the low end, and tick the confirmation box before saving.
  4. Burn at low power, just enough to mark. The line is thick at the ends and pinches to its thinnest point at the true focus.
  5. Read the mark at the thinnest point and type it into the generator: it tells you which way and how far to move.

If your laser has a motorized Z axis that LightBurn controls, LightBurn’s own Focus Test does the same job by stepping Z instead of tilting the board. Thunder Laser’s guide for its Bolt runs a coarse test, then a fine one between the two best lines, and sets the autofocus offset from the result. Once you know the spot size, the line interval & DPI calculator turns it into an engraving interval, and how thick a laser can cut shows what happens when the cut runs out of focus.

FAQ

What is the spot size of a 2 inch CO2 laser lens?
About 0.12 mm in theory, if the beam reaching the lens is 7 mm wide with a beam quality M² of 1.2: d = 4 M² λ f ÷ (π D) = 4 × 1.2 × 0.0106 × 50.8 ÷ (π × 7). Sintec Optronics’ chart for a typical CO2 laser gives 0.127 mm. A wider beam at the lens gives a smaller spot, and a worn tube or dirty optics a bigger one.
Which CO2 lens focal length should I use?
Thunder Laser’s lens guide treats 2.0 in as the general starting lens, 1.5 in for fine engraving and small text, 2.5 in for cutting where more focus tolerance helps, and 4.0 in for thick or low-density material, roughly over 10 mm, calling these starting choices rather than limits. The calculator shows why: depth of focus grows with the square of the spot size, so a longer lens trades detail for tolerance.
How do I do a ramp test on a diode laser?
Raise one end of a flat scrap board by a measured height, focus on the middle of the board as usual, and burn one straight line along the slope at low power. The line is thick at both ends and thinnest where the surface met the focus. Our generator adds height marks to the line, so you read the focus error directly: if the thinnest point is at +1.0, the true focus is 1.0 mm above the surface you focused on.
Does LightBurn have a focus test?
Yes. LightBurn’s Focus Test engraves a row of lines, each at a different Z height, and the thinnest line is the best focus. It needs a motorized Z axis that LightBurn controls, with Z control enabled in Device Settings. Without one, the tilted-board ramp test does the same job.

Sources

Last checked 2026-11-01 · Calculated values; no laser was used to make this page.