Source code file formats
Programs as people write them: plain text in a programming language, read by a compiler or an interpreter. The extension says which language the text is in.
Formats
.AS
ActionScript 1.0ActionScript 1.0 source: loose code pulled in by #include, with prototype-based objects.
.AS
ActionScript 2.0ActionScript 2.0 source: one class or interface per file, compiled to AVM1 actions.
.AS
ActionScript 3.0ActionScript 3.0 source: a package with one public class, compiled to ABC for the AVM2.
.ASM
Assembly language sourceMachine instructions as text; the syntax varies by assembler and processor.
.BAML
Binary Application Markup Language (compiled XAML)The binary form of XAML that WPF's markup compiler writes, embedded in assemblies.
.BAT
Windows batch fileCommands for the DOS or Windows command interpreter, one per line.
.C
C source codePrograms in the C language as plain text, with .h headers.
.CBL
COBOL source codeCOBOL programs and copybooks as text, in four divisions.
.CLJ
Clojure source codeClojure and ClojureScript source as text, plus EDN data files.
.CPP
C++ source codeC++ programs as plain text, with .hpp or .h headers.
.CPP
C++/CLI source codeC++ with the CLR extensions for .NET: ref classes, handles, gcnew, properties.
.CS
C# source codeC# programs for .NET as plain text, compiled to .NET assemblies.
.CSS
Cascading Style SheetsRules of selectors and declarations that style web pages.
.CU
CUDA C++ source codeC++ with NVIDIA extensions, mixing CPU code and GPU kernels in one file.
.DART
Dart source codeDart programs as UTF-8 text, each file normally its own library.
.DMO
Derive demo fileA demonstration for the Derive algebra system: expressions with ; comment lines.
.EL
Emacs Lisp source codeEmacs extensions and settings in Lisp, with a conventional header.
.F90
Fortran source codeFortran programs as text, in fixed-column or free-form layout.
.FS
F# source codeF# source, signature and script files as text.
.GO
Go source codeGo programs as UTF-8 text, one package per folder.
.HS
Haskell source codeHaskell modules as text, with a literate form in .lhs files.
.IL
CIL assembly source codeThe text of .NET intermediate language: ildasm and monodis output, ilasm input.
.INC
Include fileSource code included by another file, in assembly, Pascal, PHP, C or others.
.JAVA
Java source codeJava classes as text, compiled to .class files for the JVM.
.JS
JavaScript source codeScripts and modules for browsers, Node.js and other runtimes.
.LISP
Common Lisp source codeCommon Lisp programs as text: parenthesised forms, read in turn.
.MOD
Go module fileA Go module's path, Go version and dependencies, as line-oriented UTF-8 text.
.MTH
Derive utility fileDefinitions and expressions for the Derive algebra system, as ~-wrapped DOS text.
.PAS
Pascal source codePascal, Object Pascal and Delphi programs and units as text.
.PHP
PHP source codeServer-side programs in the PHP language as plain text, often mixed with HTML.
.PL
Perl source codePerl scripts and modules as text; .pl is also used for Prolog.
.POV
POV-Ray scene description languageThe text scene description language of the POV-Ray ray tracer.
.PROLOG
Prolog sourceProlog programs and logic databases as text.
.PY
Python source codePython programs and modules as UTF-8 text.
.RAZOR
Razor components, views and pagesHTML with C# or Visual Basic inside it: Blazor components, MVC views and Razor Pages.
.RB
Ruby source codeRuby programs and libraries as plain text, UTF-8 by default.
.RESX
.NET resource fileThe XML resource files of .NET and Windows Forms: strings, pictures, icons and typed values, built into .resources.
.RKT
Racket source codeRacket modules as text, each led by a #lang line.
.RS
Rust source codeRust programs and libraries as UTF-8 text, one module per file.
.SCM
Scheme source codeScheme programs as text: parenthesised forms, one namespace.
.SH
Shell scriptCommands for a Unix shell as text, often led by a #! line.
.SWIFT
Swift source codeSwift programs as UTF-8 text, compiled one module at a time.
.TS
TypeScript source codeJavaScript with static types, compiled to plain JavaScript.
.VB
Visual Basic source codeVisual Basic .NET source, VBScript, and VB6 and VBA modules, classes, forms and projects.
.XAML
XAML user interface and object markupXML markup that WPF, UWP, WinUI, MAUI, Avalonia and Workflow Foundation read to build objects and user interfaces.
.ZIG
Zig source codeZig programs as UTF-8 text, each file an implicit struct.