Convert GCODE to GLB Online
Upload a sliced print file or a CNC program and get back a single binary glTF (.glb) mesh built around the extrusion or cutting path. The one thing to know before you open it: the G-code coordinates are copied through unchanged, so a Z-up print lands on its back in a Y-up viewer and millimeter numbers are read as meters.
Download Started!
How would you rate your experience with MiConvert?
Why convert G-code to GLB
A .gcode file is a list of machine instructions: move to X, Y, Z at this feed rate, extrude this much filament, change layer. There is no mesh, no surface and no object inside it, which is why a three.js scene, a model-viewer embed, Blender's import menu or an AR preview has nothing to open. GLB is the opposite kind of file: one self-contained binary that viewers and game engines load directly. Converting is how you get something viewable out of a program that was only ever meant for a printer or a controller.
How to convert a G-code file to GLB
- Export the program you actually ran: Prusa, Orca, Bambu, Cura or Simplify3D output as .gcode (or .g, .gco, FlashForge .gx, PrusaSlicer binary .bgcode). Posted CNC programs are handled on the NC to GLB page. Controller extensions such as .tap, .ngc and .mpf are not accepted, so rename those to .nc or .gcode first.
- If your slicer wrote arc-fitted G-code (Arc Fitting or ArcWelder), consider re-slicing with arc fitting off: the converter reads only the end point of G2 and G3 moves, so arcs flatten into straight chords.
- Drop the file on this page and start the conversion. It runs on our servers in a Python process, not in your browser; each engine step has a ten-minute ceiling, and a .bgcode file is decoded to text G-code first within its own five-minute limit.
- Download the .glb. The link stays valid for about four hours.
- In your viewer or editor, rotate the object 90 degrees on X to stand it upright, and scale it by 0.001 if your scene works in meters, because the millimeter numbers are read as meters. Nothing in the file does this for you.
What the converter actually does
- Rebuilds geometry from the path itself: sample points are marked in a voxel grid, then a distance transform and marching cubes produce a closed surface around every kept move at a fixed 0.2 mm radius.
- FDM mode is detected automatically from the presence of an E word, and only moves where extrusion increases are kept, so travel moves and retractions do not become geometry.
- CNC programs with no E word are traced along the tool center line: G1, G2 and G3 cuts and plunges are drawn, G0 rapids are skipped.
- Removes the purge or intro line when the file has layer markers such as ;LAYER_CHANGE or ;LAYER:n, by discarding paths before the first marker and inside ;TYPE:Custom blocks.
- Reads PrusaSlicer binary G-code (.bgcode, deflate or heatshrink, MeatPack encoded) and FlashForge .gx with its embedded thumbnail header, decoding them before the mesh step.
- Delivers GLB as one complete binary file, which avoids the missing-buffer problem you get with the .gltf target on this site.
Video Tutorial
Convert GCODE to GLB online. Reconstruct 3D mesh from G-Code toolpaths for web-based 3D and AR/VR applications. Free, fast, no installation required. 📌 Convert GCODE to GLB free: https://miconvert.c
Frequently asked questions
Will this give me back the original STL or the designed part?
No. The output approximates the toolpath, not the model that was sliced. Every kept move is wrapped in a 0.2 mm-radius surface on a grid of at least 0.3 mm (voxel size is the larger of 0.3 mm and the longest side divided by 250), so fine detail rounds off and bed-size jobs come out coarse, with the infill lattice left inside the shell. If you need the real model, ask whoever sliced it for the source file.
Why is my print lying on its back and the wrong size in three.js or Blender?
GLB is a Y-up, meter-based format, and the converter writes the G-code numbers through without changing axes or units, so a 50 mm part reads as 50 meters in the Y-up convention. Rotate 90 degrees about X and apply a 0.001 scale in a meter-based scene. The same applies to the FBX, DAE and USDZ targets.
Can I convert a GLB back into G-code here?
No. This page only goes from G-code to GLB. To get printable G-code from a .glb mesh you need a slicer: convert the GLB to STL or 3MF first, then slice it in PrusaSlicer, Cura, Orca or Bambu Studio with your printer profile, since G-code depends on the machine, nozzle and material.
Does the GLB keep colors, filaments or layers?
No. The result is a single merged mesh with no material, no texture and no color. Multi-extruder files, prime and wipe towers, supports, skirts and brims are all merged into that one mesh; only custom start and end G-code is filtered out. There is no per-layer or per-feature separation, and no print settings or metadata carry over.
A circle in my CNC file is missing from the mesh.
G2 and G3 moves are read by their end point only; the I, J and R parameters are never parsed. A quarter arc becomes a straight chord, and a full circle programmed as one block, where start and end are the same point, disappears. Re-post the program with arcs output as short linear segments. Units are taken literally too: a G20 inch program keeps its inch numbers, and cutter compensation, work offsets, canned cycles, rotary axes, feed rates and spindle or laser power are ignored.
I get "No movement/extrusion commands found in G-Code file". What now?
That means the parser found nothing it could trace: a file with only rapids or travel moves, a CNC program that contains an E word (which switches the parser into FDM mode and then drops the cuts), a text file that is not G-code, or a renamed binary. Upload the sliced or posted program itself and check that cuts use G1, G2 or G3. If a .bgcode is refused as corrupted or unreadable, download it again, or export plain G-code with binary G-code turned off in PrusaSlicer; signed Prusa Connect files cannot be read.
How big a file can I convert, and how many at once?
50 MB per file as a guest, 100 MB with a free account, 200 MB on Plus and 1 GB on Pro, with 10, 10, 25 and 50 files per batch respectively. Guests and free accounts are also limited to 10 conversion jobs per hour per IP address. Very long print files can hit the ten-minute engine limit; slicing a smaller object or a single part avoids that.
What happens to my file after the conversion?
Everything is processed on our servers over HTTPS, not on your device. Your uploaded G-code is deleted as soon as the job's final attempt ends, and the GLB plus its random download link live for about four hours before being removed automatically. The link is not one-time, so treat it as private. We do log file names, sizes, formats and outcomes, and signed-in accounts keep a conversion history row.