Software & Apps > File Types What Is a CGI File? How to open, edit, and convert CGI files By Tim Fisher Tim Fisher Facebook Twitter Senior Vice President & Group General Manager, Tech & Sustainability Emporia State University Tim Fisher has more than 30 years' of professional technology experience. He's been writing about tech for more than two decades and serves as the VP and General Manager of Lifewire. lifewire's editorial guidelines Updated on August 28, 2021 Tweet Share Email Tweet Share Email File Types File Types Apps Windows MS Office Linux Google Drive Backup & Utilities Design Cryptocurrency A file with the CGI file extension is a Common Gateway Interface Script file. They are text files, but since they're written in a programming language like C or Perl, they can function as executable files under certain conditions. One example is a CGI file that holds scripts that are responsible for sending emails from a form on a website. These script files are often seen in a web server's "cgi-bin" directory. How to Open a CGI File Since CGI files are text files, the built-in Notepad program in Windows can be used to view and edit them. But other text editors can be used as well. Although it's not intended to work this way, you might sometimes try to download a file from a website but will instead get a .CGI file. For example, a bank statement or insurance bill you're downloading may come as this file type instead of a PDF (or some other format like JPG, etc.). You should be able to rename it to the file you were intending to download, and then open it like you regularly would. In this example, renaming the .CGI file to a .PDF file should let you open the PDF in a PDF viewer. The same process should work with any file in this context that's improperly named. Renaming like this doesn't actually convert them to a new format. It just changes which program opens the file. Since in this example, the document should be a PDF, renaming it to .PDF is just putting the correct file extension on the file. If you keep getting a .CGI file instead of the actual file you're after, it may be necessary to clear the browser's cache and try again. Disabling your firewall or security software may be another solution if the problem persists. How to Convert a CGI File CGI files won't work properly on a web server if you convert it to another format. However, you can still save an open one to HTML or another text-based format using a text editor we linked to above. Remember what we said above about renaming a CGI file. Doing so doesn't actually convert it to PDF, JPG, etc., but instead just puts the proper file extension on the file so that the right program will recognize and open it. An actual file conversion takes place with a file converter. It's beyond the scope of this article if what you're actually looking for is information on CGI programming. For example, if you want to translate information from a CGI form into an Excel file, you can't just convert the CGI script itself into an XLSX or XLS file. Still Can't Open It? Double-check the file extension to make sure you aren't confusing a CGM (Computer Graphics Metafile), CSI, CGR (CATIA Graphical Representation), CGF (Crytek Geometry Format), or CGZ (Cube Map) file with one that has the .CGI extension. As you can see, file extensions used between different formats can look an awful lot alike, but that doesn't necessarily mean that they're opened or converted in the same way. Was this page helpful? Thanks for letting us know! Get the Latest Tech News Delivered Every Day Email Address Sign up There was an error. Please try again. You're in! Thanks for signing up. There was an error. Please try again. Thank you for signing up! Tell us why! Other Not enough details Hard to understand Submit