Common File Extensions Reference

A file extension is the suffix that hints at a file's type and default opener. This table covers common text, code, image, document, audio/video and font extensions with meanings.

ExtensionTypeMeaning
.txtTextPlain text file
.mdTextMarkdown text
.htmlWebHypertext markup page
.htmWebHTML page (short extension)
.cssWebCascading style sheet
.jsCodeJavaScript script
.tsCodeTypeScript source
.jsonDataJSON data
.xmlDataExtensible markup language
.csvDataComma-separated values
.yamlDataYAML config/data
.ymlDataYAML config/data (short name)
.tomlDataTOML config
.pngImageLossless bitmap (supports alpha)
.jpgImageJPEG lossy image
.jpegImageJPEG lossy image
.gifImageAnimated / lossless bitmap
.webpImageModern efficient image format
.svgImageVector graphics
.icoImageIcon (favicon)
.pdfDocumentPortable document
.docDocumentLegacy Word document
.docxDocumentWord document (OOXML)
.xlsDocumentLegacy Excel spreadsheet
.xlsxDocumentExcel spreadsheet (OOXML)
.pptDocumentLegacy PowerPoint
.pptxDocumentPowerPoint (OOXML)
.zipArchiveZIP archive
.rarArchiveRAR archive
.7zArchive7-Zip archive
.tarArchiveTAR archive (often with .gz)
.gzArchiveGzip compression
.mp3AudioMPEG audio
.wavAudioLossless waveform audio
.mp4VideoMPEG-4 video
.aviVideoAVI video container
.movVideoQuickTime video
.woffFontWeb open font format
.woff2FontWeb open font format 2 (better compression)
.ttfFontTrueType font
.otfFontOpenType font
.exeBinaryWindows executable
.dllBinaryDynamic-link library
.apkBinaryAndroid package
.isoImageDisc image
.logTextLog file
.envConfigEnvironment variable config
.sqlDataSQL script
.dbDataSQLite database
.sqliteDataSQLite database

Frequently Asked Questions

What is the relationship between extension and MIME type?

The extension is the suffix at the end of a filename (e.g. .png); the MIME type (e.g. image/png) is the standard that declares content format during transfer. Servers often set Content-Type from the extension, and browsers decide how to parse from it. They are not strictly one-to-one, but most common extensions have conventional MIME types.

Which image formats are good for the web?

Photos: .jpg/.webp; transparency: .png; icons/illustrations: .svg; animation: .gif. Modern sites prefer .webp to reduce size and improve load speed.

What is the difference between .docx and .doc?

.doc is the old binary Word format; .docx is an XML-based OOXML compressed package, smaller and more robust, and is the modern Word default.

Why is a downloaded file sometimes .zip but actually code?

The extension only affects the default opener, not the real content. Archives, datasets or even malware can use any extension. To determine the real type, inspect the magic number or MIME, not the extension.