GCode Analyzer/Visualizer

by hudbrog, published

GCode Analyzer/Visualizer by hudbrog Nov 21, 2012


Hey everbody,

Wanted to show you a little project I've been working on for some time - gcode.ws
As you might've guessed by the topic name - it's a GCode visualizer. And I guess at that point most of you are asking why the hell anyone would write another one.

Well, mainly because I haven't found a single one that would comply with my humble list of requirements. I mean, most of them allows me to.. well.. visualize GCode file and nothing else. But when I open gcode - it's not for my estetical pleasure, it's to check that there are no problems and to see effects that recent slicer configuration changes done or for any other of several reasons. And the ones I've seen so far doesn't allow me to do that stuff effectively.
So I decided to write one myself.

Feature list:
1) Visualize GCode in 2D, layer by layer
1.1) Show retracts and restarts
1.2) Show print/move/retract speeds
1.3) Display only part of layer/animate squence of layer printing
2) Analyze GCode
2.1) Print time, amount of plastic used, layer height, etc. for whole file and for single layer
2.2) Reference visualized part to GCode file (i.e. select a certain part of 2d visalization, switch to GCode view - it will highlight list of lines responsible for visualized piece)
3) Multiplatform, available online (but works offline too), works locally (doesn't upload you gcode anywhere or download anything but application itself)
4) 3D visualization (I don't know what for, it's dull and useless.. need to rewrite it to be like in repetier host)
5) And yeah, it's slow, memory hungry and only supports modern browsers like chrome and ff of latests versions (maybe safari 6 and ie10, haven't checked)
6) Totaly open source so you can use it as you like )
Update 27 Nov 2012:
Lots of bug fixes, support for DC extruders (M101/M103), order of magnitude improvement in loading time for files with lots of Z movements (like Z-lifts)
Update 28 January 2013
Lots of bugfixes. Support for upper layer "shadowing" and setting extrusion visual thickness.
Update: spring 2013
Lots of things have changes. You can now use color differentiation based on flow rate, not speed. You can enable "extrusion width" emulation to see how well your infill should look. There is a highly experimental feature "error analysis" that is available at gcode.ws/?new
And it's migrated to another domain long time ago =)

Recent Comments

view all

Really useful tool I use it pretty much before every print just to check that things are set the way I wanted

Also just came across this... nice tool.... is there a file size limit? i have to check a 40mb file... know its big... its a selfwatering flowerpot

None of the other tools I have found so far are able to visualize the gcode files onther than one layer at a time, so I was delighted to find this one -- a slicing problem I first saw after wasting an hour and lots of filament would have been completely obvious when examining the 3D view in GCode Analyzer.
Thank you for creating this, it is going right into the toolbox! :-)

More from 3D Printing

view more

Liked By

view all


Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag


Current state it somewhat stable, at least I use it myself all the time. Easiest way to use it - just go to gcode.ws
Alternatively - you can download a snapshot of sources from attachment or go to github.com/hudbrog/gCodeViewer/
If you wish to use it locally (i.e. with sources on you local machine) - you will need to add "--allow-file-access-from-files" parameter to chrome(which is unsafe and I DO NOT RECOMMEND it), otherwise it won't work.


You must be logged in to post a comment.

lisalionheart on Mar 5, 2014 said:

Really useful tool I use it pretty much before every print just to check that things are set the way I wanted

boelle on Feb 19, 2014 said:

Also just came across this... nice tool.... is there a file size limit? i have to check a 40mb file... know its big... its a selfwatering flowerpot

ZeAllan on Feb 13, 2014 said:

None of the other tools I have found so far are able to visualize the gcode files onther than one layer at a time, so I was delighted to find this one -- a slicing problem I first saw after wasting an hour and lots of filament would have been completely obvious when examining the 3D view in GCode Analyzer.
Thank you for creating this, it is going right into the toolbox! :-)

apru on Feb 8, 2014 said:

Just wanted to say thank you for writing this software/website. It's used daily by me to check my g-code. Sometimes it's just cool to show it too. Friends think it's neat to be able to visualize the tool paths.

cmcguinness on Jan 5, 2014 said:

This is a great tool to help me when I'm debugging a design -- I can validate that the gcode is going to print the object correctly (or not), saving me from starting the print and discovering problems then...

ratthanin on Dec 9, 2013 said:

nothing happen after select G code file.. maybe something wrong with my chrome browser?

hudbrog on Dec 9, 2013 said:

Could you publish the gcode file you are trying to view somewhere? Like dropbox or mega, just so I can use it to debug.

Botmaster on Dec 8, 2013 said:

Brilliant Thank you

lovethepirk on Nov 11, 2013 said:

AWESOME!!!! I can learn what this bot is doing now!!!

Raistlin82 on Oct 12, 2013 said:

That is _SERIOUSLY_ _AWESOME_! Really, I can't help, any time I slice something, coming here and checking how it will be printed... Really, great work and huge thanks!

One thing that I'm noticing is, if I use G0 (the command for the rapid movements: http://reprap.org/wiki/G-code#... for retractions, it looks like they're not showed (and I'm talking about both the red dot of the retraction and the green line of the subsequent travel move). Is that something known? Is there a plan to support it? I surely can provide some screenshots, g-code samples, or whatever you think it could be of help.

Thanks again for the amazing piece of software! :-D

hudbrog on Oct 12, 2013 said:

It's strange about G0, it should be treated by the same code as G1. Can you create an issue on github and attach a sample gcode file that has that issue?

Msquare on Sep 20, 2013 said:

Best thing since sliced bread !

hilekar on Aug 17, 2013 said:

Very nice work. I am wondering if you could add a start and stop button for each layer to see actually where the extrusion stops. Kind of like virtual printing, but a great job indeed.

hudbrog on Aug 18, 2013 said:

Hey, thanks! You can use two bottom sliders to to achieve kind of virtual printing effect.

damienb on May 4, 2013 said:

Amazing job, very clear visualization! Thanks for sharing.

tovarna on May 1, 2013 said:

great! I built a rostock with a friend, and we have been printing (calibrating) about a week. And your application will be very helpfull!

eagleapex on Apr 27, 2013 said:

This is awesome

ril3y on Apr 14, 2013 said:

Hey very cool! I think I have a whole bunch of files that do not render right. They are normal 2D cnc drawings. If you wanted to check it out for yourself they are all here in the TinyG project.


hudbrog on Apr 15, 2013 said:

Hi, sorry, this viewer is mainly for 3d printer-specific gcode variation.. there is no support for more general cnc routers gcode planned.

Zydac on Mar 5, 2013 said:

This is great!

kj6epl on Jan 28, 2013 said:

A really useful tool! Good job!

One technical difficulty though: it appears the website you are hosting it on is a bit unreliable. Sometimes it loads right away, sometimes it takes a couple minutes to load, and sometimes I get a connection timeout error. Any ideas why?

BTW the offline version works without changing "dangerous" settings in the latest version of Opera.

hudbrog on Jan 28, 2013 said:

Hi, thanks! Basically, whole application is a static page, after you load it once - it should be stored in your browser cache for quite a long time. I've signed up for a monitoring service to check latency from different parts of the world. If it shows significant problems - I'll move it to another hosting.

Lenbok on Jan 27, 2013 said:

This looks fantastic!!! Is there a way to start up this viewer with a named gcode file from the command-line rather than needing user interaction? (I currently have tatlin being invoked automatically by slic3r and skeinforge when they finish slicing to review what they've done, but wouldn't mind swapping to yours.)

hudbrog on Jan 28, 2013 said:

Hi, unfortuantely html5 filereader api requires user to select file manualy, otherwise it would be kinda unsecure. I might get to building a standalone app for that in future thou.

andyways on Jan 11, 2013 said:

Finally tried this out. Really really awesome. Thank you!
Runs better in Safari than Pleasant 3d!

Any chance we can see repeater host style 3d representation?
Being an in browser app is simply the best thing.

I wonder how long before the entire toolchain for slicing becomes a webapp.

hudbrog on Jan 11, 2013 said:

Hey, thanks. I was looking into changing 3d representation to be more repetier host like, but every solution I came up with was either time or memory intensive, most of the time - both. Maybe I'll look some more into it, but I'm not very enthusastic about 3d view since I don't see much use for it.

EricYoung on Jan 5, 2013 said:

Well done, thanks for your hard work.

pgreenland on Jan 2, 2013 said:

Amazing tool! Only just found it but already wouldn't be without it :-)

Kyoxilbuzz on Dec 27, 2012 said:

Just freaking awesome...i love it. Thanks so much Monsieur Hudbrog!!!

Casey7747 on Dec 21, 2012 said:

Great Mate! Awesome use of functional colouring(coloring)! 2D+3D :)

hellphish on Dec 14, 2012 said:

This is freaking awesome

Vienna_Thomas on Dec 9, 2012 said:

Great work!  Runs perfekt :-)

SteveCaplin on Dec 6, 2012 said:

This is excellent. What a great way to visualise the printing process! Thanks so much.

Zcool31 on Dec 3, 2012 said:

This works great on Skeinforge and Slic3r, but doesn't show me anything with MakerWare-generated gcode. Could you look into it?

hudbrog on Dec 4, 2012 said:

Fixed ) Should work now. 

adamsbriand on Nov 30, 2012 said:


I wish I could make changes in the 2D interface and have it recreate the corresponding portion of GCode.

hudbrog on Dec 3, 2012 said:

Ahh, that's a whole lot of a different tool you're requesting. I'll think about that, but for now it seems like writing one from ground up would be easier =)

paulcardno on Nov 29, 2012 said:

Hi Hudbrog
Not sure what I'm not doing right here but I cannot get your app to view the different layers. I'm using version 17 of firefox, and in 2D view  pressing up and down arrow, also page up and page down. The scoll bar on the bottom works but not the up and down scroll bar. hmm not sure what I'm missing here. Also tried chrome version 23, same thing.

hudbrog on Dec 3, 2012 said:

There was a bug with layer identification when Z goes up and immediately down. Should work now. 

doctek on Nov 30, 2012 said:

 Try using the up and down arrow keys. These work for me. You can also click on the scroll bar, but that jumps too much, IMHO.

hudbrog on Nov 29, 2012 said:

Can you please send me your gcode file to [email protected], I'll take a look. Most likely a bug )

Ante on Nov 28, 2012 said:

Wonderful tool!

3D view is blank for me on Windows 8 Pro 64bit, Firefox 17.0.
Intel HD4000 / Nvidia GeForce GT 630M. I've forced Firefox to use both without any difference.

(The objects show up nicely in 3D on Ubuntu Linux at work, so the objects should be alright)

hudbrog on Nov 29, 2012 said:

Thanks! Can you show me the output of javascript console after you've tried to switch to 3d mode? 

steeve_becker on Nov 27, 2012 said:

Excellent Job !!

doctek on Nov 26, 2012 said:

Bug report:

First vector after a layer change or other Z-lift is not plotted correctly.
Since there is no way to attach images, I'll send you the files directly.

hudbrog on Nov 26, 2012 said:

Thanks! I've fixed at least one bug that was causing incorrect visualization of the first commands on the layer. There could by more thou, please check.

sgraber on Nov 23, 2012 said:

This is *nice*! 

One feature request: any chance you could add either the ability to zoom in on a model or define how large our build platforms are? The Makerbot Cupcake's/TOM's are a 100mm x 100mm build platform whereas many repraps are 200mm x 200mm.

hudbrog on Nov 23, 2012 said:

You should be able to zoom in/out with mouse scroll both on 2D and 3D views. With platform size.. I was planning on adding plastic parameters and other physical settings in near future.

emmett on Nov 22, 2012 said:

I tried this with a 20mm box and it worked great. Every file I've given it since has gotten to 100% and then showed nothing (except the Gcode file itself). The view and info are all blank. I'm using Firefox. Am I missing something?

hudbrog on Nov 23, 2012 said:

I've fixed the bug I've mentioned before. If you still get blank page - please, send me the files you're having problems with.

hudbrog on Nov 22, 2012 said:

That might be a known bug, you need to reload page every time you view new file. I'm planning on fixing it pretty soon. If it doesn't help I'd appreciate if you could share the files you are trying to view and OS/browser versions.

NM-Buzzard on Nov 22, 2012 said:

Maybe I'm missing it, but it would be real nice to have a key-scroll combo to scroll through layers (as in Pronterface) instead of having to drag the scrollbar.

hudbrog on Nov 23, 2012 said:

You can now use pgup/pgdwn or arrow keys to switch layers in 2D view. 

hudbrog on Nov 22, 2012 said:

Hm, good idea, I'll implement hotkeys on the weekend, shouldn't be that hard.

UechiMike on Nov 22, 2012 said:

Works great for me on my mac.  The 3D UI is a little twitchy/sensitive but it does the job.  Great work.

doctek on Nov 21, 2012 said:

This is a really nice tool! Should really help tracking down obscure slicing problems.

Minor point: Are color mappings off a little? In my "Layer info" box, two move speeds are listed, but both have the same color (green). "Retract speed" has a red code, but a dark blue dot is shown on the rendering. These are minor and the tool is totally usable as is. Just thought you might like to know about it.

hudbrog on Nov 21, 2012 said:

Thanks. I guess I need to write some kind of documentation to avoid confusion )
Moves are always green, no matter how many speeds there are.  Just so you can always visually see which lines are moves and which are extrusion without checking layerinfo box.  
With retractions there are two types of dots - retracts and restarts. Retracts are red, restarts are blue. I only show red on the speed list thou, I can add blue dot there too ) I guess I should remove red color from the list of possible extrusion line colors..

yzorg on Nov 21, 2012 said:

How to run this app?
is it not suitable for mac users?
i only got a bunch of folders and html files.

I ve been happy with 3D pleasant too (with repG) but since it doesnt support the colours from CURA and just gives me a white drawing.. i cant use it anymore.

Maybe someone knows ho i do have to change my gcode in CURA that i get the fullcoloured view in 3D Pleasant again.
Maybe its just adding some extra lines in the Start gcode file..-

hudbrog on Nov 21, 2012 said:

For some reason I don't see my previous answer, so I'll reply again. It does work on any OS (I am using it on macos), but requires a modern version of chrome of firefox browser. It is a web application, so all you need to do to use it - is go to the link I've provided in description and drag your gcode to the designated area.

UechiMike on Nov 21, 2012 said:

Nice.  I've been pretty happy with Pleasant3D on my mac - but I'll give this a whirl and see how it does for me.  It's always nice to have more than one option for visualization tools.

hudbrog on Nov 21, 2012 said:

Thanks, let me know how it works for you.