b2KIT

STL to OBJ Converter

Convert STL 3D models to OBJ format with optional normal recalculation.

Tested tool guide Tested browser tools Checked August 16, 2026

What STL to OBJ Converter does, with a checked example

An STL file is a triangle soup: every facet lists its three corners in full, so a cube ships as 36 vertices even though it has only 8. This converter parses the soup, merges coincident corners, and writes a Wavefront OBJ - one 'v' line per unique vertex, one 'f' line per triangle, indexed from 1. It can also recalculate normals from the geometry instead of trusting facet records, which often ship missing or wrong. The usual surprises: the OBJ's vertex count will not match the STL's, OBJ indices start at 1, and the conversion runs locally, so your model is never uploaded.

Worked example

A concrete input and expected output from the current implementation.

Input

solid sample
  facet normal 0 0 1
    outer loop
      vertex 0 0 0
      vertex 1 0 0
      vertex 0 1 0
    endloop
  endfacet
endsolid sample

Expected output

v 0 0 0
v 1 0 0
v 0 1 0
vn 0 0 1
f 1 2 3

Each corner of the single triangle becomes one 'v' line, and the triangle becomes 'f 1 2 3' because OBJ numbers vertices from 1. With recalculation enabled, the normal is computed from the edges: (1,0,0) x (0,1,0) = (0,0,1), matching the stored facet normal, so orientation and shading are unchanged.

How the result is produced

1

Reading the triangle soup

ASCII STL is readable text; binary STL is an 80-byte header, a triangle count, then packed 50-byte facet records. Because binary files usually begin with the word 'solid' in that header, the variant is told apart by structure and file length, never by the first word. Each triangle's corners are matched against corners already seen; identical positions collapse into one 'v' entry with a 1-based index.

2

Normals: stored or rebuilt

Facet normals in STL are often unreliable: many exporters write zeros, and tools disagree about which side of a surface is 'outside'. With recalculation on, each face normal is derived from the triangle's own edges as a normalized cross product, and vertex normals are blended from the faces that meet at that vertex, producing smooth shading. Off, stored normals are copied through, or omitted when the file has none.

Good uses

  • Moving a model from a slicer or CAD export into a renderer, game engine, or older viewer that imports OBJ but not STL.
  • Rescuing meshes that shade black or blotchy: missing or wrong STL normals are rebuilt from the geometry, and the fixed OBJ re-imports cleanly.
  • Hand-editing or diffing a mesh in version control: the deduplicated OBJ is small, plain text, and greppable, where a binary STL is an opaque blob.

Limits and checks

  • Units and scale pass through unchanged: STL records bare coordinates with no unit, and the converter adds no scale factor. A model exported in inches stays inch-sized, and neither format records which unit that is.
  • Rebuilt normals follow each triangle's vertex order, not an explicit inside flag. If the source mesh winds some triangles backwards, those faces get inward normals and render as holes or inside-out. Recalculation repairs bad normal data, not a broken mesh.
  • The OBJ is geometry only. STL carries no color, texture coordinates, or materials, so the output has no 'vt' texture lines or material references - reapply textures, colors, and material names after conversion.

Common questions

Why does my OBJ list 8 vertices when the STL exported 36?

STL writes every corner in full for every triangle, so corners shared between adjacent triangles appear many times in the file. The converter merges coincident positions, so the OBJ lists each unique corner once and references it by index. The face count is unchanged; only the vertex table is deduplicated.

Is my 10 mm model still 10 mm after conversion?

Only if the source says so. Neither format stores units, and the converter passes coordinates through without scaling, so the OBJ's numbers equal the STL's numbers exactly. If the original was exported in inches, the OBJ is in inches; most viewers let you pick the unit on import.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools