KerfScript Playground

Write laser cutting designs as code in KerfScript, the language we made for cut, score and engrave. Start from one of 24 examples, drag the sliders your code creates and download SVG or DXF for your laser.

KerfScript code

Start from

Console

echo() output, warnings and errors show up here.

New to KerfScript? Follow the step by step guide or open the language reference.

Preview

Running the code…

Vector Export

Settings

Add a comment like // [10:1:100] after a top-level variable and it shows up here as a slider.

How To Use

1

Pick an example under Start from, or write your own code. The preview updates a moment after you stop typing.

2

Top-level variables with a comment like // [10:1:100] become Settings under the code. Moving a slider rewrites the number in the code, so the code and the settings always agree.

3

Switch the preview to Laser file to see the layers your laser software gets: red cut lines, blue score lines and black engraving.

4

If something is wrong, the line turns red and the Console says why. echo() prints values there too.

5

Download the SVG or DXF for your laser, save the .kerf code, or use Copy link to share the design with the code inside the link.

Need deeper setup tips? Visit the MyLaserTools Learning Center.

Frequently Asked Questions

Yes. The KerfScript Playground is free with no limits, no watermarks and no sign-up, and the files you make are yours to cut, sell and share.

No. Start from one of the 24 examples and change it with the sliders, or change a number in the code and watch the preview follow. The step by step guide in the Learning Center takes you from your first shape to finger joints.

SVG in millimetres with one layer each for cut, score and engrave, and DXF with matching layers. A design on several sheets downloads one DXF per sheet. You can also save the .kerf code or open the result in the Design Editor.

Any software that imports SVG or DXF, including LightBurn, xTool Creative Space, Glowforge, Inkscape and CAD programs. The layers are coloured red for cut, blue for score and black for engrave, so each one can get its own power and speed.

No. KerfScript runs in your browser. Copy link puts the code inside the link itself, so nothing is stored on our side.

It uses the same style of modules, loops and customizer comments, but it is made only for flat laser work: cut, score and engrave layers, kerf compensation, finger joints and sheet layout are built in, and there is no 3D model to project.

Visit the MyLaserTools Learning Center for a step-by-step KerfScript Playground guide, plus material tips and file-format help for laser cutting, CNC, and 3D printing. The guides walk you through every setting and how to prepare your files for your machine.

Open the KerfScript Playground guide

About

What is KerfScript?

KerfScript is a small programming language for laser cutting, made by MyLaserTools. You describe a part with shapes, numbers and a few lines of logic, and KerfScript turns it into a laser file with separate cut, score and engrave layers. Change one number and the whole design follows: a box gets wider and its finger joints are counted again, a clock face gets more marks, a list of names becomes a sheet of gift tags.

This playground runs KerfScript right in your browser. Your code is not uploaded and there is nothing to install. The same code also runs from the command line and inside other apps, see the KerfScript website.

What the code looks like

Here is a tag with a hanging hole and an engraved name. The comment after width turns it into a slider from 40 to 200 mm:

width = 80; // [40:5:200]
label = "Hello";

difference() {
  rect([width, 40], r = 6, center = true);
  translate([-width / 2 + 8, 0]) circle(d = 5);
}

engrave() text(label, size = 12, halign = "center", valign = "center");

difference() cuts the hole out of the rounded rectangle, and engrave() puts the text on the engrave layer. Paste it into the editor above and try it.

Made for the laser, not adapted from 3D

  • Layers you can send straight to the laser. cut(), score() and engrave() put lines on their own coloured layers, and layer() adds your own.
  • Kerf compensation. Tell material() how much your laser burns away and every cut outline moves by half of it, so tabs and slots fit snugly.
  • Joinery built in. Finger joints, slots, T-slots for nuts, living hinges and a ready-made box library, all sized from your material thickness.
  • Parts and sheets. Name pieces with part(), say how many you need, and KerfScript lays them out on sheets of your size and lists each part with its cut length.
  • Text as outlines. text() uses the fonts on MyLaserTools and turns letters into paths, so your laser software never has to guess the font.

If you know OpenSCAD

KerfScript will feel familiar: modules, functions, for loops, difference() and translate() work the way you expect, and the customizer comments are the same. The difference is that everything is flat and made for the laser, so there are no 3D shapes to project and no holes or layers lost on the way to an SVG.

Free and open

The playground is free, and the files you make are yours to cut, sell and share. KerfScript itself is open source on GitHub under the AGPL licence, with a commercial licence for companies that want to build it into closed products.

To learn more, follow the step by step guide or read the full language reference.