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.0

ActionScript 1.0 source: loose code pulled in by #include, with prototype-based objects.

.AS

ActionScript 2.0

ActionScript 2.0 source: one class or interface per file, compiled to AVM1 actions.

.AS

ActionScript 3.0

ActionScript 3.0 source: a package with one public class, compiled to ABC for the AVM2.

.ASM

Assembly language source

Machine 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 file

Commands for the DOS or Windows command interpreter, one per line.

.C

C source code

Programs in the C language as plain text, with .h headers.

.CBL

COBOL source code

COBOL programs and copybooks as text, in four divisions.

.CLJ

Clojure source code

Clojure and ClojureScript source as text, plus EDN data files.

.CPP

C++ source code

C++ programs as plain text, with .hpp or .h headers.

.CPP

C++/CLI source code

C++ with the CLR extensions for .NET: ref classes, handles, gcnew, properties.

.CS

C# source code

C# programs for .NET as plain text, compiled to .NET assemblies.

.CSS

Cascading Style Sheets

Rules of selectors and declarations that style web pages.

.CU

CUDA C++ source code

C++ with NVIDIA extensions, mixing CPU code and GPU kernels in one file.

.DART

Dart source code

Dart programs as UTF-8 text, each file normally its own library.

.DMO

Derive demo file

A demonstration for the Derive algebra system: expressions with ; comment lines.

.EL

Emacs Lisp source code

Emacs extensions and settings in Lisp, with a conventional header.

.F90

Fortran source code

Fortran programs as text, in fixed-column or free-form layout.

.FS

F# source code

F# source, signature and script files as text.

.GO

Go source code

Go programs as UTF-8 text, one package per folder.

.HS

Haskell source code

Haskell modules as text, with a literate form in .lhs files.

.IL

CIL assembly source code

The text of .NET intermediate language: ildasm and monodis output, ilasm input.

.INC

Include file

Source code included by another file, in assembly, Pascal, PHP, C or others.

.JAVA

Java source code

Java classes as text, compiled to .class files for the JVM.

.JS

JavaScript source code

Scripts and modules for browsers, Node.js and other runtimes.

.LISP

Common Lisp source code

Common Lisp programs as text: parenthesised forms, read in turn.

.MOD

Go module file

A Go module's path, Go version and dependencies, as line-oriented UTF-8 text.

.MTH

Derive utility file

Definitions and expressions for the Derive algebra system, as ~-wrapped DOS text.

.PAS

Pascal source code

Pascal, Object Pascal and Delphi programs and units as text.

.PHP

PHP source code

Server-side programs in the PHP language as plain text, often mixed with HTML.

.PL

Perl source code

Perl scripts and modules as text; .pl is also used for Prolog.

.POV

POV-Ray scene description language

The text scene description language of the POV-Ray ray tracer.

.PROLOG

Prolog source

Prolog programs and logic databases as text.

.PY

Python source code

Python programs and modules as UTF-8 text.

.RAZOR

Razor components, views and pages

HTML with C# or Visual Basic inside it: Blazor components, MVC views and Razor Pages.

.RB

Ruby source code

Ruby programs and libraries as plain text, UTF-8 by default.

.RESX

.NET resource file

The XML resource files of .NET and Windows Forms: strings, pictures, icons and typed values, built into .resources.

.RKT

Racket source code

Racket modules as text, each led by a #lang line.

.RS

Rust source code

Rust programs and libraries as UTF-8 text, one module per file.

.SCM

Scheme source code

Scheme programs as text: parenthesised forms, one namespace.

.SH

Shell script

Commands for a Unix shell as text, often led by a #! line.

.SWIFT

Swift source code

Swift programs as UTF-8 text, compiled one module at a time.

.TS

TypeScript source code

JavaScript with static types, compiled to plain JavaScript.

.VB

Visual Basic source code

Visual Basic .NET source, VBScript, and VB6 and VBA modules, classes, forms and projects.

.XAML

XAML user interface and object markup

XML markup that WPF, UWP, WinUI, MAUI, Avalonia and Workflow Foundation read to build objects and user interfaces.

.ZIG

Zig source code

Zig programs as UTF-8 text, each file an implicit struct.