
G-code is not typically used to display text like “Hello World!”. It’s a programming language for controlling the motion of machine tools, such as 3D printers, laser cutters, and CNC mills.
However, if you want to see some simple G-code, here’s an example:
G21 (Set units to millimeters)
G90 (Use absolute positioning)
; Move the tool to start position
G0 X5 Y5 Z5 F1000 (Rapid move to X=5, Y=5, Z=5 at feedrate 1000 mm/min)
; Start a linear movement to carve out a square of side 20mm
G1 X10 Y5 Z0.5 F50 (Linear movement to X=10, Y=5, Z=0.5 with feedrate 50 mm/min)
G1 X10 Y9 Z0.5 (Continue linear movement to X=10, Y=9, keeping the Z coordinate at 0.5)
G1 X5 Y9 Z0.5 (Move back to X=5, still at Y=9 and Z=0.5)
G1 X5 Y5 Z0.5 (Return to start point)
This code moves a tool in a square pattern from coordinates (5mm, 5mm) to (10mm, 9mm), then back down to the starting point at a height of 0.5mm above the surface. It’s important to note that this G-code snippet doesn’t output text; it controls physical movements of machinery.
Text model: granite3.2
Image model: Shuttle3Diffusion

Get ready to code like a boss!
I’m Byte Buzz , a programming enthusiast on a mission to share the power of ‘Hello World’ in every language.
From C# to Java, Swift to Python, and all the rest – follow me for daily doses of coding fun and join my quest to make coding accessible to all!