· STEP and STL

STEP units: millimetres vs inches in CAD exports

STL has no unit field. Whatever the STEP declares, the triangles inherit, right or wrong.

On this page
  1. Where does the STEP declare its unit?
  2. Why is my STL 25.4 times too big or too small?
  3. Why can’t the STL be fixed after conversion?
  4. Can file size tell you which units were used?
  5. The measure-box check
  6. Reading the unit out of the file
  7. What the declaration looked like in a real file
  8. What if the declaration itself is wrong?
  9. What if only some parts are the wrong size?
Technical diagram: A 25.4× gap is born before the STL is written, because the unit is dropped. Diagram, not a photograph.

A STEP file states its length unit once, in an entity attached to the geometry. If that statement disagrees with the numbers the designer typed, the STL comes out exactly 25.4 times too large or too small while every geometric check still passes.

Where does the STEP declare its unit?

A Part 21 STEP file is plain text. The geometry lives inside a shape_representation, and that representation points at a LENGTH_UNIT. Millimetre files use SI_UNIT(.MILLI.,.METRE.). Inch files use a CONVERSION_BASED_UNIT whose conversion factor is a LENGTH_MEASURE_WITH_UNIT of 25.4 mm.

OpenCascade documents the behaviour plainly: length units, plane angle units and the uncertainty value are taken from the shape_representation entities, and its own internal unit defaults to millimetres through the xstep.cascade.unit parameter. The OCCT STEP translator guide sets out both. The format reference on this site covers the same ground from the file-format side.

The human-readable header is not the authority. FILE_DESCRIPTION often says “millimetres” or “inches”, and exporters write that line from a template, from the last document setting, or from nothing at all. The unit entity beside the geometry is what a reader applies.

Why is my STL 25.4 times too big or too small?

There are two directions, and both look like a working conversion.

In the first, the numbers are inches and the document says millimetres. A designer works in inches, the CAD system writes 4.0 for a 4-inch plate, and the STEP declares millimetres. This happens when the document unit does not match the unit the designer typed: the STEP carries the document’s unit and the numbers unchanged. SolidWorks takes that unit from Document Properties > Units, Fusion 360 from Document Settings > Units. A reader that trusts the declaration builds a 4 mm plate. In a 0.2 mm layer height that is twenty layers, a coin rather than a bracket.

In the second, the numbers are millimetres and the document says inches. SolidWorks and Fusion 360 both declare the document unit, so the fault is a document setting rather than a conversion step. A designer types 200 for a 200 mm bracket, the document unit is inches, and the STEP declares inches; a reader builds a 200-inch part, which is 5080 mm. That is larger than any desktop printer’s build volume, so the slicer either refuses to place it or the user scales it by 0.03937 to make it fit, which happens to be the right fix for this particular error.

Metres and centimetres produce the same class of fault at 1000× and 10×. All of them are dimensional errors that survive every downstream check, because the mesh itself is valid: closed, correctly wound, and simply the wrong size.

Why can’t the STL be fixed after conversion?

Binary STL is an 80-byte header, a 4-byte triangle count, then 50 bytes per triangle holding a normal and three vertices as raw floats. There is no field for a unit and no convention for one. Every slicer assumes millimetres because nothing else is available to assume.

Conversion on this site asks OpenCascade for millimetre output, which means the STL is consistent with whatever the STEP declared. The converter applies the declaration; it cannot audit it.

Can file size tell you which units were used?

Binary STL is a fixed record, so size is countable rather than typical:

file bytes = 84 + 50 × triangles

A 20 MB file holds (20,000,000 − 84) ÷ 50 ≈ 400,000 triangles; a 1 MB file holds about 20,000. ASCII STL stores the same mesh as text at roughly five times the size, which is worth knowing before you read a large download as a fine mesh.

The part that matters for this page: a unit error changes none of those numbers. Oversizing by 25.4× moves the vertex coordinates, not the triangle count, so the file is the same length whether the plate is 4 mm or 101.6 mm. File size can confirm what resolution you exported at, never what units you exported in.

Converter result panel for the inch-declared cube: 508 mm bounds from 20-unit coordinates.
The inch-declared fixture keeps the coordinates 20 and imports at 508 mm across.

The measure-box check

Do this before slicing anything that came from outside, and do it on the converted file rather than the STEP preview.

  1. Open the STL in the slicer or mesh viewer and read the bounding box.
  2. Compare the largest dimension with the drawing or with the dimension the supplier quoted.
  3. Measure one feature whose size you know: a 6 mm hole, a 40 mm bolt spacing, a 200 mm overall length.
  4. Divide the measured value by the expected value and read the ratio.

The ratio names the fault:

Measured ÷ expected Declaration Fix
25.4 millimetres read as inches scale by 1/25.4
0.03937 inches read as millimetres scale by 25.4
1000 millimetres read as metres scale by 0.001
0.001 metres read as millimetres scale by 1000
10 millimetres read as centimetres confirm the unit, then scale by 0.1

Confirm which unit was mixed before scaling; the ratio names the fault but not which side of the conversion was wrong.

One worked example: a part whose drawing says 160 mm across, showing 4064 mm in the slicer, gives 4064 ÷ 160 = 25.4. The geometry was modelled in millimetres, the file declared inches, and every feature is 25.4 times its intended size. Scaling the mesh by 1 ÷ 25.4 recovers the part, but only if the declaration was the only problem; if the file mixes unit systems between parts, scaling fixes one and breaks the other.

Reading the unit out of the file

Because STEP is text, the declaration can be inspected without CAD. Search the file for LENGTH_UNIT, SI_UNIT or CONVERSION_BASED_UNIT and read the entity. A millimetre document shows SI_UNIT(.MILLI.,.METRE.); an inch document shows a conversion-based unit with 25.4 in its measure. On a large file the search returns many hits, because every geometric representation can carry its own, so read the one attached to the representation that holds the solid.

Assemblies are where this gets awkward. Each shape_representation may declare its own unit, and a reader that converts each one correctly can still produce a model whose parts are at different scales, because that is what the file described. After conversion the parts are merged, and the resulting mesh carries the mismatch with no record of which triangle came from which representation.

What the declaration looked like in a real file

We converted two versions of the same 20 mm cube in Chrome on 13 November 2026 and parsed both STLs. The first is the plain millimetre file; the second was written by OCCT 7.7.2 with its output unit set to inches, which changes the declaration but leaves the coordinates at 20 units. That is exactly the mismatch case: numbers in millimetres, document labelled inches.

What was read cube-20mm.step cube-20mm-written-inch.step
Declared unit SI_UNIT(.MILLI.,.METRE.) CONVERSION_BASED_UNIT('INCH', …) at 25.4 mm
Coordinates in the STEP 20 units 20 units
Panel bounds 20 u × 20 u × 20 u 508 u × 508 u × 508 u
Parsed STL bounds 20 × 20 × 20 mm 508 × 508 × 508 mm
Triangles 12 12
STL bytes 684 684
PrusaSlicer 2.9.7 size 20 × 20 × 20 mm 508 × 508 × 508 mm

The second row is the whole page in one file. The geometry did not change and neither did the triangle count or the byte size; only the declared unit did, and the reader multiplied by 25.4. PrusaSlicer reports the 508 mm box, and trimesh reads the volume as 131,096,512 mm³ against 8,000 mm³ for the intended cube, a ratio of 16,387 or 25.4³. Nothing in the STL records which of the two is right. Fixtures: cube-20mm.step and cube-20mm-written-inch.step; readings: tests page.

The output’s 80-byte header holds the writer’s credit line and nothing else, so there is no unit field to inherit.

What if the declaration itself is wrong?

A converter cannot verify the declaration. If the designer typed inch values into a document labelled millimetres, every reader in the chain will agree with the label, and the mesh that comes out is valid and wrong. No conversion tool can detect that from the file alone, and a tessellation tolerance will not help, because the mesh is exactly what the STEP asked for. The check that catches it is external: a drawing, a known dimension, or the supplier’s own measurement.

Stop and ask rather than scale when two features disagree. Measure two things: the bounding-box ratio (measured ÷ expected) and the ratio of a feature whose size you know, such as a 6 mm hole. If the two ratios differ by more than 1%, the file is mixed and scaling the whole mesh trades one error for another. A box ratio of 25.4 next to a hole ratio of 1.0 (6.0 mm measured ÷ 6.0 mm expected) is the classic case. A STEP re-export with the correct units, or a dimensioned drawing to check against, is the only reliable repair.

Once the size is confirmed, the supplier handoff guide covers what else to verify before printing, and checking walls and clearances is the next measurement pass. For the tolerance side of the same conversion, see chord tolerance and file size.

Converter result panel for cube-20.stl: 12 triangles and 20 mm bounds.
The cube fixture after conversion: 12 triangles and 20 mm bounds.

What if only some parts are the wrong size?

An assembly carried in two unit systems gives two ratios that disagree. Say the housing measures 25.4× its drawing and the lid measures 1.0×. Scaling the merged mesh by 1/25.4 fixes the housing and shrinks the lid to 3.9% of its size, because 1 ÷ 25.4 = 0.03937. The merged STL records no provenance, so which triangles came from which shape_representation is unrecoverable after conversion. Split the assembly before converting, check each bounding box on its own, then assemble the results.

By the steptostl.org Editor Team · Reviewed 14 November 2026. We converted both cube files in Chrome on 13 November 2026; the unit entities were read with grep, the exported STLs were parsed for triangles, bounds and shell count, and the 508 mm file was opened in PrusaSlicer 2.9.7 and trimesh 4.12.2 for the size and volume readings. The inch-declared file was written by OCCT 7.7.2 with write.step.unit set to INCH, so its declaration is a real exporter output and its coordinates were not edited. No print was made.

Sources: OCCT STEP translator guide, OpenCascade, current revision at access. STL export options, SolidWorks. How to set units in Fusion 360, Autodesk. ISO 10303-21:2016, Industrial automation systems and integration — Product data representation and exchange — Part 21, LENGTH_UNIT and shape_representation. All accessed 12 November 2026.

How this page was made: the entity names and the xstep.cascade.unit parameter come from the OCCT guide; the 25.4, 0.03937, 1000 and 10 ratios were computed here from the unit definitions. Drafted with AI assistance and reviewed by the Editor Team.

Try it on your own file

Open the STEP to STL CAD converter and drop a file. It runs in this tab; nothing is uploaded and no account is needed.

All posts