The concept of Virtual Instruments(VI) and the advantages of VI development environment LabVIEW are introduced. A virtual spectrometer is designed with LabVIEW in which light is dispersed by a prism or a grating and the whole spectrum is detected by a CCD. The intensity of light is converted to digital signals and transferred to the computer by a data acquisition device. The spectrum data are analyzed and displayed by high-integrated modules in LabVIEW,using a graphical programming language called G-Language. It is high-efficient,timesaving,easily-used and easily-extended.