Skew Correction Calculator (Test Square)
Runs entirely in your browser — your numbers never leave your device.
Worked example
A 100 mm test square whose diagonals measure 144.00 mm and 139.00 mm: (144² − 139²) ÷ (4 × 100²) = (20,736 − 19,321) ÷ 40,000 = 0.035375 — Marlin M852 I0.03538, Klipper SET_SKEW XY=144.00,139.00,100.0. That is a badly skewed frame (a true 100 mm square's diagonal is 141.42 mm); a healthy printer shows a diagonal difference under about 0.5 mm.
How it works
Skew is the fault that hides behind 'my circles are ovals and my squares are diamonds': the X and Y axes are not perfectly perpendicular, so every shape shears. The diagonal test exposes it because a sheared square's diagonals become unequal while its sides stay the same length — side measurements alone will never catch it. Print the largest square your bed allows (bigger squares make the difference easier to measure), one or two layers or a thin frame, and measure corner to corner with calipers, consistently inside-to-inside or outside-to-outside.
Fix the frame first if you can — a gantry that is visibly out of square, a loose frame bolt or uneven belt tension is better corrected mechanically, and firmware compensation then only mops up the remainder. Marlin takes the computed factor directly (M852 I<factor>, with S1 enabling skew compensation; the factor must also be compiled in on stock firmware, which not all vendor builds do). Klipper instead takes the raw measurements via SET_SKEW XY=<diagonal1,diagonal2,side> and works the factor out itself, and its skew profiles can be saved per the official skew-correction guide linked below. Related shape faults: ovals from backlash or belt issues belong with motion-tuning fixes, and holes that are round but small belong to the hole tolerance calculator.
The formula: Skew factor k = (diagonal 1² − diagonal 2²) ÷ (4 × side²), from the shear relation d1² − d2² = 4kL². Ideal diagonal = side × √2. Marlin: M852 I<k>. Klipper: SET_SKEW XY=<diagonal 1, diagonal 2, side>.
Questions people ask
Which diagonal is diagonal 1?
The one starting at the origin corner of the square (the corner nearest the printer's home position, following the Klipper test-object convention). If your factor comes out with the wrong sign — prints skew further instead of straightening — swap the two diagonals.
How big a diagonal difference is normal?
Under about 0.5 mm on a 100 mm square is a healthy frame. 1–2 mm is worth compensating; beyond that, check the frame mechanically first — firmware can correct it, but the underlying looseness usually gets worse.
Does skew correction fix oval holes too?
Only ovality caused by skew. Ovals from backlash, loose belts or a wobbling pulley need mechanical fixes; measure first — if both diagonals are equal, your problem is not skew.
Sources

A fully worked example, step by step
Use the pre-filled test square above: a square printed with 100 mm sides, where you measured one diagonal at 141.9 mm and the other at 140.9 mm. On a perfectly square frame those two diagonals would be identical, so the difference tells you the skew.
- Find the ideal diagonal. For a 100 mm square, the diagonal should be 100 × √2 = 141.42 mm. Both of your measurements sit either side of that number.
- Find the diagonal difference. 141.9 − 140.9 = 1.0 mm. That gap is the visible symptom of the frame leaning.
- Turn it into a skew factor. Combining the two diagonals against the ideal gives a skew factor of 0.00707.
- Turn it into an angle. That factor works out to a skew angle of about 0.41° — small on paper, but enough to stop square parts fitting together.
- Copy the Klipper form exactly as given: SET_SKEW XY=141.9,140.9,100 — the two diagonals you measured, followed by the side length.
Apply that correction, reprint the same square, and the two diagonals should now measure the same.
Reading a diagonal difference
A difference of 1.0 mm over a 100 mm test piece is clear skew, not measuring noise — a square frame gives equal diagonals, and the further apart they drift, the more your prints lean. Software correction works well, but check the frame first: a loose belt, a racked gantry or one corner sitting higher than the rest is better fixed with a wrench than with a setting. The most common input mistake is swapping the two diagonals or measuring a test piece that was not printed as a true square to begin with. If moves themselves travel the wrong distance, check that first with the steps per mm calculator.