Subscribe to The Chicago Manual of Style Online
Q. How should we handle file extensions like PDF (portable document format, an Adobe Acrobat file)—lowercase, preceded by a period, or all uppercase? Other examples are GIF and JPG (or JPEG).
A. We consider these to be initialisms or acronyms, as the case may be, when they are not doing duty as file extensions appended to a file name: so PDF, JPG, GIF.