What is the FS file format?
.fs is the source file extension for F#, a functional-first, strongly typed programming language developed by Don Syme at Microsoft Research. F# targets the .NET runtime and compiles to .NET Intermediate Language via the F# compiler, fsc.
An .fs file is plain UTF-8 text containing an ordered sequence of module or namespace declarations, open import statements, type definitions, let bindings, and expressions. Crucially, order matters in F#: the compiler processes declarations top-to-bottom, and files within a project must be listed in the .fsproj project file in explicit compilation order - unlike C# or Java, where intra-project declaration order is generally irrelevant.
F# supports functional programming idioms (immutable data by default, pattern matching, discriminated unions, computation expressions) alongside object-oriented features inherited from .NET. The language has evolved from version 1.0 (2005, Microsoft Research) to F# 9.0 (2024).
Companion extensions include .fsi (F# interface/signature files, analogous to C header files) and .fsx (F# script files, executed without explicit compilation via dotnet fsi). The Fable compiler can transpile .fs source to JavaScript, enabling browser and Node.js targets.
.fs files are supported natively by Visual Studio 2022, JetBrains Rider, and Visual Studio Code with the Ionide extension.
Security & safety
RISK: LOWPlain text source code; no executable risk when viewed. Risk arises only if you compile and run untrusted F# code.
Format details
in a nutshell- BRKSYS FS (file-system image) - Some emulator/OS toolchains use .fs for raw filesystem images; unrelated to F# source.
- Haskell module (rare) - Occasionally .fs suffix appears in older Haskell codebases, but .hs is the standard; very rare.
Programs that open FS files
Technical details
deep spec| Language | F# - functional-first, strongly typed .NET language developed by Don Syme at Microsoft Research |
| Encoding | UTF-8 text; BOM optional; Visual Studio defaults to UTF-8 without BOM |
| Compiler | `fsc` (F# compiler); compiles `.fs` files to .NET IL; invoked via `dotnet build` in MSBuild projects |
| Compilation order | Files must be listed in `.fsproj` top-to-bottom; order is semantically significant - forward references are not allowed |
| Language versioning | F# language version set via `LangVersion` property in `.fsproj`; current is F# 9.0 (2024) |
| Paradigm | Functional-first (immutable by default, pattern matching, discriminated unions, computation expressions) with full OOP support |
| Type system | Hindley-Milner type inference; explicit type annotations optional in most contexts |
| Module system | Top-level `module` or `namespace` declarations; circular references between files are not permitted |
| Companion extensions | `.fsi` (interface/signature file), `.fsx` (script), `.fsproj` (MSBuild project file) |
| Runtime targets | .NET 6+ on Windows, Linux, macOS; also JavaScript via the Fable transpiler |
| Scripting mode | `.fsx` files run via `dotnet fsi` without explicit compilation; `.fs` files require a project or direct `fsc` invocation |
| IDE support | Visual Studio 2022, Visual Studio Code with Ionide extension, JetBrains Rider |
| Released | 2005 (F# 1.0, Microsoft Research); Visual Studio integration since 2010 (VS 2010) |
| Latest version | F# 9.0 (2024) |
| Open standard | Yes · royalty-free |
| Specification | fsharp.org |
FS conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about FS files.