So if .STL files are 3D only, what the 2D files are? maybe .DXF?
Every CAD or drawing program will have their own specific file format.
For CNC purposes, you want a file type that contains vector information.
.dxf is the most commonly used, because most programs can open and export .dxf files. The .dxf format was created for this reason.
Some CAM programs can read many different file types, some can only read .dxf files.