Guide May 18, 2026

How to Convert STL to GLB — For Web, AR & Sharing

STL is great for 3D printing. GLB is great for everything else. Here is how to convert between them using free tools, and why you would want to.

Why Convert STL to GLB?

STL and GLB serve fundamentally different purposes. STL was designed in 1987 for stereolithography — it stores raw triangle geometry and nothing else. No colors, no materials, no textures, no scene hierarchy, no metadata. It is the plain text file of 3D formats: simple, universal, and limited.

GLB is the binary container for the glTF 2.0 format, created by the Khronos Group as the "JPEG of 3D." It stores geometry, materials, textures, animations, and scene structure in a single optimized file. It is the native format of the modern web 3D ecosystem, supported by every major browser, framework, and platform.

Here are the concrete reasons to convert:

Method 1: Blender (Free, Desktop)

Blender is the most versatile free tool for 3D file conversion. Here is the complete process for converting STL to GLB with materials.

  1. Import the STL. Open Blender. Go to File > Import > STL (.stl). Select your file. The model will appear as grey geometry in the viewport.
  2. Add a material. Select the object. In the Properties panel, go to the Material tab. Click New. You now have a default Principled BSDF material. Adjust the Base Color to give the model a color. For a plastic look, set Roughness to 0.4-0.6. For metal, set Metallic to 1.0 and Roughness to 0.2-0.4.
  3. Optionally add textures. If you have texture images (color map, normal map, roughness map), connect them to the Principled BSDF node inputs in the Shader Editor. The GLTF exporter will bake these into the GLB file.
  4. Check the scale. GLTF uses meters as its default unit. If your STL was designed in millimeters (common for 3D printing), the model will appear 1000x too large in a GLTF viewer. Scale the object by 0.001 (select all, S, 0.001, Enter) and apply the scale (Ctrl+A > Scale).
  5. Export as GLB. Go to File > Export > glTF 2.0 (.glb/.gltf). In the export dialog, set the format to glTF Binary (.glb). Under "Mesh," check Apply Modifiers. Under "Geometry," consider enabling Draco Compression for smaller files. Click Export.

The entire process takes 2-5 minutes for a simple model. The resulting GLB file will be significantly smaller than the original STL and will include materials, making it immediately usable on the web and in AR.

Method 2: Command Line with gltf-pipeline

For batch conversion or automated workflows, command-line tools are more practical than a GUI application. The process requires two steps: first convert STL to GLTF (using a tool like assimp), then optimize the GLTF (using gltf-pipeline).

Install the tools via npm: npm install -g gltf-pipeline. For STL to GLTF conversion, you will also need the Open Asset Import Library (assimp), available through most package managers. The workflow is: assimp export model.stl model.gltf followed by gltf-pipeline -i model.gltf -o model.glb --draco.compressionLevel 7. The second command converts the GLTF to binary GLB format and applies Draco compression.

For Python workflows, the trimesh library can load STL files and export GLTF/GLB programmatically. This is useful for server-side conversion pipelines where you need to process uploads automatically.

Method 3: Online Converters

Several websites offer STL to GLB conversion without installing software. You upload your STL, choose output settings, and download the result. This is convenient for one-off conversions but comes with caveats: your file is uploaded to a third-party server, conversion quality varies between services, and most free tiers have file size limits.

If you use an online converter, verify the output carefully. Some converters produce oversized files because they do not optimize the mesh. Others strip normals or produce incorrect face winding, resulting in models with black patches or inverted faces. Always check the converted file in a viewer before using it in production.

Tips for Better Conversions

Add materials before converting

An STL converted to GLB without adding materials will still look like grey geometry — just in a different file format. The whole point of GLB is that it supports rich materials. Take the extra minute to add at least a base color and roughness value. It makes a dramatic difference in how the model looks in a viewer or AR.

Optimize textures

If you add textures, keep them reasonable in size. A 4096x4096 texture embedded in a GLB file adds 16-64 MB depending on format. For web use, 1024x1024 or 2048x2048 is usually sufficient. Use JPEG compression for color textures (no transparency needed) and PNG for normal maps and masks. The GLTF format also supports KTX2/Basis Universal compressed textures, which are smaller and load faster on the GPU, but require additional tooling to create.

Use Draco compression

Draco is a geometry compression library developed by Google. It is supported natively in the GLTF specification and reduces geometry data by 80-95%. The trade-off is that the viewer needs a Draco decoder — but all major web 3D frameworks (Three.js, Babylon.js, model-viewer) include Draco support out of the box. For web delivery, there is almost no reason not to use it.

Check the coordinate system

STL files typically come from Z-up environments (Blender, CAD). GLTF specifies Y-up. Most exporters handle this conversion automatically, but verify by loading the GLB in a viewer. If the model is on its side, the axis conversion was not applied during export.

Skip the Conversion Step

GeometryViewer opens both STL and GLB files natively. If you just need to view or share a model, you do not need to convert at all — drop your STL directly into GeometryViewer and share the link. Conversion is only necessary when your target platform requires GLB (AR viewers, web embeds, game engines).

Open STL Viewer

When to Keep STL

Conversion is not always necessary or desirable. Keep your files in STL format when you are sending models to a 3D printer or slicer software (they expect STL or 3MF), when you are working in a CAD pipeline that uses STL as an interchange format, or when you need maximum compatibility with legacy software. STL's simplicity is its strength in these contexts — every 3D tool on earth can read an STL file.

For everything else — web, AR, sharing, embedding, visualization — GLB is the better format. The conversion is straightforward, the file size savings are substantial, and the visual quality improvement from adding materials makes the effort worthwhile.