Chris Collins

Tools · fabrication

G-code sender

Stream G-code from the browser over Web Serial to a GRBL, grblHAL or FluidNC CNC router or laser, or a Marlin 3D printer — with jogging, work zero, overrides, a live toolpath preview, a bounds check, and a console.

Added · updated 28 October 2026

Works with

How to use it

A G-code sender in a web page. Plug the controller in over USB, press Connect, and it talks to the machine directly through Web Serial — no Candle, UGS, bCNC or Pronterface to install. It speaks GRBL 1.1 and its descendants (grblHAL, FluidNC) for routers and lasers, and Marlin for printers.

Browser support: Web Serial works in desktop Chrome, Edge and Opera only — not Safari, Firefox or mobile browsers. Without it the page still loads files and shows the preview, size, bounds and time estimate; it just cannot connect. Only one program can have the port open, so close any other sender first. On Linux your user needs access to the serial device (usually the dialout group).

How to use it

  1. Choose the baud rate — 115200 for GRBL, grblHAL and FluidNC; 115200 or 250000 for Marlin (choosing 250000 assumes Marlin until the firmware says otherwise) — and press Connect.

  2. The firmware is read from the banner the board prints when it resets, or by asking $I and M115 if it does not. You can force GRBL or Marlin with the selector.

  3. GRBL: if homing is enabled the controller starts in Alarm; press ⌂ Home ($H). Unlock ($X) clears the alarm without homing — use it only when you know where the machine is.

  4. Jog to your work origin with the pad or the keyboard, then Zero X/Y/Z (this sends G10 L20 P1 X0…, setting G54).

  5. Open a .nc, .ngc, .tap or .gcode file (or drop it, or paste it). Check the preview, the size and the warnings, then Send file. A summary asks you to confirm before anything moves.

The red Stop and Reset buttons and the yellow Hold stay at the top of the tool while you scroll.

Streaming

  • GRBL family: the character-counting protocol. Lines go out as long as everything not yet answered fits in the controller’s 128-byte receive buffer; each ok or error:N frees the oldest line. If a grblHAL or FluidNC board reports a larger buffer (Bf: in its status report) when idle, the sender uses that size. Comments and spaces are stripped before sending, and lines over GRBL’s 80-character limit are flagged before you start.

  • Marlin: send-and-wait, one line at a time, each numbered and checksummed (N12 G1 X5*93). If the printer receives a corrupted line it answers Resend: N and the sender goes back to line N. busy: messages during long moves and heating are expected.

  • Errors: a GRBL error:N during a job puts the machine in feed hold and pauses sending, with the code’s meaning and the file line it came from. Resume carries on, Stop ends the job. An ALARM:N ends the job and shows what the alarm means.

  • Start at line sends from that file line, after the modal state the earlier lines set up (units, absolute/incremental, work offset, plane, feed, spindle and coolant). The first move goes straight from wherever the tool is, so raise Z first if that could hit anything. After a stop the field is set to the last line the controller accepted — on GRBL that is up to ~15 moves ahead of where the tool actually was, because the controller plans ahead.

Hold, stop and reset

  • Hold sends GRBL’s feed hold (!): the axes slow to a stop and keep their position. On Marlin it stops sending; the printer finishes the moves it already has.

  • Resume sends cycle start (~), or resumes sending.

  • Stop (GRBL) holds, waits until the machine has stopped, then soft-resets (Ctrl-X). This keeps the position; resetting while moving would lose it. (Marlin) drops the rest of the file and sends M410 (quick stop), heaters off and fan off.

  • Reset / M112 is the emergency version: GRBL soft reset at once (which may need re-homing), or Marlin M112, after which the printer must be reset by hand.

None of these is a substitute for the machine’s own emergency stop button.

Position, jogging and overrides

The position panel shows work and machine coordinates, feed, spindle speed, overrides, the planner and receive buffers and any input pins GRBL reports, polled four times a second. Jogging uses GRBL’s $J=G91… jog commands, which the controller checks against soft limits and which can be cancelled mid-move (✕, or Esc, sends jog-cancel 0x85). Pick a step (0.01–100 mm) and the XY and Z feeds. With Keyboard jog on, the arrow keys jog X and Y, Page Up/Down jog Z, Esc cancels and Space holds. On Marlin a jog is a relative G0 between G91 and G90.

The override buttons send GRBL’s real-time override bytes: feed ±10 %/±1 %, rapids 25/50/100 %, spindle ±10 %/±1 %. On Marlin they set speed (M220) and flow (M221).

Preview, time and bounds

The preview plots X and Y: blue for cuts (or extrusion), dashed red for rapids (grey for printer travel), green for what has been sent, and a red circle for the tool. Arcs (G2/G3, with I/J or R) are drawn as arcs. The time estimate is each move’s length divided by its feed rate, with rapids at the controller’s $110–$112 maximum rates once the settings have been read (otherwise at the rapid rate you enter) and G4 dwells added. It ignores acceleration, so real jobs usually take longer; while a job runs, the remaining time is scaled by how the machine is actually doing.

The bounds check compares the program’s extent with the machine travel ($130–$132, or the values you enter — Machine profile fills them in for an X-Carve, Shapeoko or generic router from the X-Carve and GRBL settings tool’s list). With homing enabled and a work offset known, it also checks where the program would go in machine coordinates — GRBL machine space runs from −travel to 0 unless $23 reverses an axis.

Console and settings

The console shows what was sent (›) and received. Hide status reports and polling keeps the <Idle|…> reports, ok`s for large files and temperature polls out of the way; they are still in Save log. ↑/↓ recall earlier commands. `?, ! and ~ typed alone go as real-time commands.

Read settings ($$) lists the GRBL settings with their meanings; edit a value and press Enter to write it. On Marlin, Report settings (M503) prints them in the console.

Printers

With Marlin the temperatures panel polls M105 every two seconds and graphs the hotend and bed (solid: actual, dashed: target) for five minutes, with buttons to set or switch off the heaters. Position comes from M114.

Privacy

Nothing leaves your computer. Files are read in the browser and sent only to the serial port. The page remembers your baud rate, firmware choice, jog step and feeds, travel and console history in this browser’s local storage.

Runs entirely in your browser; nothing you type leaves this page.