DEV Community

Casey Marlin
Casey Marlin

Posted on

How to Convert GLB to STL for 3D Printing (No Software Install)

The Problem

AI 3D generators like Meshy, Tripo, and Luma export models as GLB (binary glTF) — the standard format for web viewers and AR. But if you want to 3D-print that model, you need STL — the format every slicer understands.

Most online converters upload your file to a server. If you're working with proprietary models or just value privacy, that's a dealbreaker.

The Solution: Client-Side Conversion

I built STL Mesh, a browser-based converter that runs entirely on the client. Your file never leaves your device — the conversion happens in a Web Worker using three.js.

How it works under the hood

  1. GLB parsing: The three.js GLTFLoader reads the binary container, extracting mesh geometry, node transforms, and scene hierarchy.

  2. Transform baking: Each mesh's transform chain is flattened to world space. A GLB scene can have nested nodes with translation, rotation, and scale — all of that gets baked into final vertex positions.

  3. STL encoding: The STLExporter writes binary STL at 50 bytes per triangle: a normal vector (3×float32) + three vertices (9×float32) + an attribute byte count (uint16). No materials, no textures — just triangles.

The unit trap

This catches everyone at least once: glTF counts in meters, but slicers assume STL numbers are millimeters. A model that's 0.05 units in GLB (5 cm) becomes 0.05 mm in your slicer — invisible.

The converter shows the bounding box dimensions so you can spot this before downloading. If your numbers look 1000× too small, scale by 1000 in the slicer.

Format coverage

The same architecture handles other format pairs:

From To Use case
GLB → STL Print AI-generated models
OBJ → STL Print sculpts and scans
FBX → STL Print game/animation assets
3MF → STL Extract mesh from slicer projects
STL → GLB Put print files on the web
STL → USDZ iOS AR Quick Look
SVG → STL Extrude logos into 3D prints

All converters at stlmesh.com.

Try it

Drop a GLB on the converter page, check the bounding box, download the STL, open it in your slicer. The whole flow takes about 10 seconds.

If you're building something similar, the key libraries are:

  • three.js GLTFLoader / STLExporter
  • Everything runs in a single browser tab — no server component needed

Built by Casey Marlin. Feedback and feature requests welcome.

Top comments (0)