X CNC Library · free online 2.5D CAM tool
STEP to G-code converter
Load your 3D STEP (.step / .stp) model directly in the browser with true B-rep geometry; generate pocket, profile, peck/helical hole and counterbore toolpaths verified through all three CODESYS X CNC gates.
- Your STEP file stays in your browser, never uploaded
- 3-gate check: Dialect + Stock/G51 + X_CNC
- CODESYS X CNC output (.cnc)
- For 2D drawings: DXF → G-code
How to use it
-
1
Open a STEP file
Drop your 3D solid (.step / .stp) or pick a sample part. The top machining direction is suggested automatically.
-
2
Choose material & tool
Start quickly with material presets and standard diameters (Ø3–Ø12); set raw stock margins or exact box dimensions.
-
3
Review the 3 gates
Dialect, stock-removal/G51 corner simulation and the CODESYS X CNC motion kernel automatically verify the generated program.
-
4
Download or simulate
Once all three gates are green, download the .cnc file or launch it directly in the live X CNC Web HMI simulator.
Three-gate safety verification
- 1. X CNC dialect: One G per line, F/FF in mm/s, 6-decimal arc midpoint projection, no forbidden G codes, ASCII only.
- 2. Independent stock simulation: Simulates stock removal purely from the G-code text to catch part gouges, G0 rapid collisions and G51 D0.05 corner rounding deviations.
- 3. CODESYS X CNC kernel: The exact planner and interpolator used on the controller validates axis velocity, acceleration, jerk and software limits up to 2 hours of motion.
Open-source components & licence notice
To process your CAD file locally in the browser without uploading it, this tool uses the following open-source libraries:
-
OpenCascade Technology (OCCT 7.x) —
replicad-opencascadejs· LGPL-2.1 (OCCT Exception) · Source -
Clipper2 —
clipper2-wasm· Boost Software License 1.0 (BSL-1.0) - Three.js — MIT Licence
Build: c1fc0b4-2026-12-02
· OCCT WASM: 21.9 MB (4.8 MB Brotli)
Frequently asked questions
Is my STEP file uploaded to a server?
No. Your STEP file is processed locally in your browser with WebAssembly (OpenCascade + Clipper2) and never leaves your computer. For the third verification gate, only the generated G-code text is sent to /api/xcnc-demo/check for X CNC planner verification and is never stored.
Why is download locked until all three gates pass?
To ensure the program runs safely on the machine, three independent gates check the generated text: (1) X CNC dialect and arc endpoint tolerance, (2) independent stock-removal simulation (gouges, G0-in-material, and G51 D0.05 corner blending), and (3) the CODESYS X CNC motion kernel (axis velocity, acceleration, jerk and software limits).
Which CNC controllers is the G-code generated for?
Output targets CODESYS X CNC (X CNC Library) exclusively: one G code per line, F and FF in mm/s, relative I/J arcs, G51 D / G38 O1 corner smoothing, and 180° half-arc helical milling. Drilling uses pure G0/G1 peck moves instead of G81/G83.
Which parts is it suitable for, and what are its limits?
It is built for 3-axis single-setup prismatic 2.5D parts (pockets, shoulders, contours, through/blind holes, counterbores and face milling). Undercuts are protected and flagged rather than cut; files above 50 MB are rejected to protect browser memory.
Why does the first load download ~5 MB?
To read true analytic B-rep STEP geometry (planes, cylinders, cones, arcs) instead of triangulated meshes, the OpenCascade WebAssembly kernel (21.9 MB raw, 4.8 MB Brotli) is downloaded once and cached by your browser.
Can I simulate the generated G-code in the browser?
Yes. The "Open in X CNC simulator" button hands the G-code directly to the live X CNC Web HMI demo. Both the verification gate and the Web HMI simulator support programs up to 2 hours of motion (telemetry frames are automatically decimated for long programs).
Planning a CNC project?
Toolpaths up to 5 axes on your CODESYS machine with X CNC Library
In this section
Estun Automation
CODESYS
Crevis
Nexcom / Nexcobot
Leroy-Somer
Servo Systems
AC Drive + Motor
DC Drives
Smart PLC
Panel PC / IPC
Remote I/O
Machine Vision Cameras
Edge AI Computer