Image to G-code for GRBL lasers

Turn a logo, drawing or photo into G-code you can open in LaserGRBL and run on a GRBL laser. Set the size, power and speed, then download. Free, and your picture stays on your computer.

Drop an image here to make G-code

Already have an SVG or DXF? It gets checked, fixed and saved at the size you need.

No image handy? Try one:

How it works

  1. Add your picture

    A logo, a drawing or a photo. JPG, PNG, WebP, GIF, BMP and AVIF work.

  2. Keep LaserGRBL

    LaserGRBL is already picked, so you get G-code. Pick another program if you need a DXF or SVG instead.

  3. Set the size

    Type the width or the height in millimeters or inches.

  4. Choose the job, set the laser and download

    Cut every shape, cut the outline, engrave, engrave and cut around, a stencil with bridges, or single lines. Then set the power as a percentage, your machine’s maximum power value ($30) and the speed. Open the file in LaserGRBL with File > Open File.

What is in the file

  • M4 (dynamic power) with S0 on every travel move, so the laser stays off between shapes even if your machine is not in laser mode ($32=0).
  • Power written as a share of your machine’s maximum S value: 30% on a machine set to 1000 is S300, on a machine set to 255 it is S77.
  • Curves as G2 and G3 arcs, which GRBL and LaserGRBL run directly, so circles stay round and the file stays small.
  • Engraving first, as scan lines 0.1 mm apart unless you change it, then the cut.
  • The origin at the lower-left corner of the design, so every coordinate is positive.
  • The file ends with the laser off (M5) and a move back to X0 Y0.

Questions

What is the max power value ($30)?

GRBL scales laser power from 0 up to the number in its $30 setting. The GRBL default is 1000, and some diode lasers use 255. Type your machine’s value so the percentages mean what you expect. To see it, send $$ in LaserGRBL’s console and look for the $30 line.

Source: GRBL v1.1 settings, $30 (gnea/grbl wiki)

What power and speed should I start with?

It depends on the laser and the material, so test on a scrap piece first. The defaults are 30% power and 1,000 mm/min for cutting, and 20% and 3,000 mm/min for engraving. Change them before you download.

Can I open this G-code in LightBurn?

Better not. In our test, LightBurn 1.7.08 left out the G2 and G3 arcs when it imported G-code, so round holes and rounded corners went missing. LightBurn makes its own G-code: download a DXF for it on the Image to DXF page instead.

Does it work for a CNC router or a pen plotter?

Not yet. The G-code here is for lasers. For a CNC router, download a DXF for Carbide Create or your CAM program. For a pen plotter, choose Single lines and download an SVG for Inkscape.

Is my picture uploaded?

No. Tracing and the G-code both happen in your browser, and your picture is never sent anywhere.

Can it engrave a photo in grayscale?

Not yet. Engraving fills the traced shapes at a single power level, so a photo turns into black-and-white shapes, not shades of gray. For a grayscale photo, use the image engraving in your laser software.

More converters

  • Image to DXF

    JPG, PNG or photo to a DXF or SVG at the size you type.

  • SVG to G-code

    SVG or DXF to laser G-code, fixed and at the size in your file.