A G-Code simulator is a type of software tool that provides a virtual representation of a CNC machine’s tool path made by following the instructions in a G-Code file. They range from simple simulators that output a single image of the tool path to complex tools that can detect collisions and plot the path in 3D. The question is a bit vague. Remember that you will need to generate a model in a CAD program (if you are working in 3D), then transform the model to G-Code using a CAM program, then use the G-Code to operate your CNC mill or lathe. For generating your 3D model, I recommend FreeCAD as an open source product.
Mach3 CNC
Mach3 is a software package which runs on a PC and turns it into a very powerful and economical Machine Controller.
Mach3 is a full featured CNC controller suitable for controlling the Lathe ,Mill, Plasma Cutter, Router, Engravers etc.

Below is a list of Mach3 Mill G code with description.
If you like to read Mach3 Turn G code read Mach3 Turn G-Code List
Mach3 Mill
Mach3 G Code List Mill
Milling G Code Software
| G Code | Description |
|---|---|
| G0 | Rapid positioning |
| G1 | Linear interpolation |
| G2 | Clockwise circular/helical interpolation |
| G3 | Counterclockwise circular/Helical interpolation |
| G4 | Dwell |
| G10 | Coordinate system origin setting |
| G12 | Clockwise circular pocket |
| G13 | Counterclockwise circular pocket |
| G15/G16 | Polar Coordinate moves in G0 and G1 |
| G17 | XY Plane select |
| G18 | XZ plane select |
| G19 | YZ plane select |
| G20/G21 | Inch/Millimetre unit |
| G28 | Return home |
| G28.1 | Reference axes |
| G30 | Return home |
| G31 | Straight probe |
| G40 | Cancel cutter radius compensation |
| G41/G42 | Start cutter radius compensation left/right |
| G43 | Apply tool length offset (plus) |
| G49 | Cancel tool length offset |
| G50 | Reset all scale factors to 1.0 |
| G51 | Set axis data input scale factors |
| G52 | Temporary coordinate system offsets |
| G53 | Move in absolute machine coordinate system |
| G54 | Use fixture offset 1 |
| G55 | Use fixture offset 2 |
| G56 | Use fixture offset 3 |
| G57 | Use fixture offset 4 |
| G58 | Use fixture offset 5 |
| G59 | Use fixture offset 6 / use general fixture number |
| G61/G64 | Exact stop/Constant Velocity mode |
| G68/G69 | Rotate program coordinate system |
| G70/G71 | Inch/Millimetre unit |
| G73 | Canned cycle – peck drilling |
| G80 | Cancel motion mode (including canned cycles) |
| G81 | Canned cycle – drilling |
| G82 | Canned cycle – drilling with dwell |
| G83 | Canned cycle – peck drilling |
| G84 | Canned cycle – right hand rigid tapping |
| G85 | Reaming Canned Cycle |
| G86 | Intended Boring Canned Cycle |
| G87 | Intended Back Boring Canned Cycle |
| G88 | Intended Boring Canned Cycle |
| G89 | Boring Canned Cycle |
| G90 | Absolute distance mode |
| G90.1 G91.1 | Set I J Mode |
| G91 | Incremental distance mode |
| G92 | Offset coordinates and set parameters |
| G92.x | Cancel G92 etc. |
| G93 | Inverse time feed mode |
| G94 | Feed per minute mode |
| G95 | Feed per rev mode |
| G98 | Initial level return after canned cycles |
| G99 | R-point level return after canned cycles |