G-codes may be generated from CAD/CAM software which gets input from one of two ways: the geometry of a CAD drawing; or the source code of the CAD/CAM program, which is simply geometric data entered by the CAD/CAM programmer. Modern CAD/CAM software generally has provision for documenting the entire machining process, from the selection of cutting tools and fixtures to special instructions on finishing or preparation for a later process.

G-codes are also routinely entered by CNC machine operators at the machine console keyboard and stored in the memory of the machine. This method is generally preferred in small machine shops where accountability for the manufacturing process is not as important as in large companies. Many modern CNC machines have operating system software that includes improved G-code libraries and conversational or intuitive programming modes that work much like a wizard on a home computer.

In the early days of CNC or NC machining, as it was then called, there were no CAD/CAM software or programmers. G-codes were entered into portable typewriter-like machines that punched precisely-positioned holes into endless lengths of paper or nylon tape. This tape was then fed into the NC machine once for every cycle or unit of production, since the machines had no permanent memory. Later, when machines came with memory, the tapes only had to be read once by the machine. At this point, the capacity of machine memory was minimal, so the tapes had to be stored for later use. Modern machines can store literally hundreds of programs and can be uploaded and downloaded with floppy discs or other media or directly from a central network or portable notebook computer.

Most of the code referred to as G-code consists of codes that begin with a letter other than G. But this borders on the trivial.