BGCODE to STL: Turn Prusa Binary G-code Back Into a Model
Drop a .bgcode file from PrusaSlicer, a Prusa MK4, MINI, XL or CORE One and get a solid STL rebuilt from its toolpaths. Everything runs on your device.
In short: To convert a .bgcode file to STL, drop it on this page: MeshShift decodes the Prusa binary G-code in your browser, shows the layers, rebuilds the printed toolpaths into one closed solid and lets you download it as STL, 3MF or OBJ, free and without uploading the file.
A .bgcode file is the compressed binary form of G-code that PrusaSlicer writes for newer Prusa printers. It is split into blocks: file and printer metadata, slicer settings, preview thumbnails and the G-code itself, which is usually compressed with deflate or heatshrink and often packed with MeatPack. MeshShift reads every compression and encoding in version 1 of the format, so files from PrusaSlicer, PrusaConnect and the printer's USB stick all work. Because G-code stores nozzle moves rather than surfaces, the STL is an approximation of the printed part, with layer steps and rounded fine detail. It is the right tool when the original model is lost, not a way to recover CAD.
How to use the BGCODE to STL tool
- Drop the .bgcode file on the page; it is decoded in your browser.
- Check the layer count, layer height and filament length in the preview.
- Let MeshShift rebuild the extrusion paths into a closed solid.
- Choose STL, 3MF or OBJ as the output format.
- Download the model and open it in your slicer or CAD tool.
What is inside a .bgcode file
Prusa introduced binary G-code in 2023 to make print files smaller and faster to read on the printer. A .bgcode file starts with the letters GCDE, a version number and a checksum type, then a series of blocks. Each block has a type, a compression method and its size:
- File metadata: the producer, for example PrusaSlicer and its version.
- Printer metadata: printer model, nozzle diameter, filament type, estimated time and filament used.
- Thumbnails: PNG, JPG or QOI previews shown on the printer screen.
- Print metadata and slicer settings: the full profile used to slice.
- G-code blocks: the actual moves, usually compressed with heatshrink and encoded with MeatPack, a scheme that packs common G-code characters into four bits.
A normal text editor shows only binary noise, and many converters reject the file because they only expect plain .gcode text. MeshShift reads the header, skips the thumbnails, decompresses each G-code block, unpacks MeatPack and then treats the result exactly like a plain G-code file.
How the STL is rebuilt from toolpaths
G-code says where the nozzle moved and how much plastic it pushed out, layer by layer. MeshShift takes every extruding move, gives it the width and height of a real printed line, and fills a 3D grid around the part with those lines. The outer surface of that grid becomes a single watertight mesh in millimetres, standing on the build plate with Z up.
The grid resolution limits detail. Walls, overall shape, holes and text that were large enough to print come back well. Very thin features, sharp corners and the original smooth curves come back rounded and stepped by the layer height. Supports and brims are part of the toolpath too, so remove them in the STL editor or your slicer if they were printed with the part.
When converting BGCODE to STL makes sense
- You still have the print file from the printer or PrusaConnect, but the original STL or 3MF is gone.
- You want to reprint a part on a different printer and need a model the new slicer can use.
- You want to measure a printed part's real size, or check what a downloaded print file actually contains, before sending it to the printer.
- You need a rough model to design a matching lid, mount or replacement around.
If you still have the original model, use it: slicing it again is always more accurate than rebuilding from G-code.
BGCODE vs. plain G-code
Both hold the same commands. Plain .gcode is text and is usually several times larger; .bgcode is smaller, carries structured metadata the printer can read without parsing the whole file, and its blocks can be checked with CRC32. PrusaSlicer can write either one: the binary option is in the printer settings. MeshShift accepts .gcode, .gco, .g and .bgcode, and shows the slicer name and filament length for each.
Frequently asked questions
Is BGCODE to STL conversion free?
Yes. Decoding, previewing and rebuilding the solid are free with no account, no watermark and no file-size limit. Nothing is uploaded, so very large print files only depend on your device's memory.
Will the STL be identical to the original model?
No. A slicer throws the original surfaces away, so any converter can only rebuild the printed shape. It matches the outside of the print closely but has layer steps, rounded small details and any supports or brim that were sliced with it.
Which .bgcode files are supported?
Version 1 of the libbgcode format, which is what PrusaSlicer, PrusaConnect and current Prusa firmware use. All compressions (none, deflate, heatshrink 11/4 and 12/4) and all encodings (plain, MeatPack and MeatPack with comments) are decoded.
Can I convert BGCODE to plain G-code?
MeshShift decodes it to G-code internally, but it does not save G-code files. To get a text .gcode, slice the model again in PrusaSlicer with binary G-code turned off, or rebuild the STL here and slice that.
Can I open a .bgcode file on a phone?
Yes. The page works in Safari on iPhone and in Chrome on Android. Phones have less memory, so very long prints rebuild more slowly, but the decoding itself is fast.
Why does my slicer show extra pieces after I import the STL?
Skirts, brims, supports and purge lines are extrusions too, so they become part of the rebuilt solid. Delete them in the STL editor, or use your slicer's split-to-parts function and remove the pieces you don't need.



