FastFormat 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global FastFormat --version 1.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local FastFormat --version 1.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=FastFormat&version=1.2.0
                    
nuke :add-package FastFormat --version 1.2.0
                    

FastFormat

A fast C# formatter that respects .editorconfig rules. Designed to be significantly faster than dotnet format for pure formatting tasks.

Performance

In benchmarks formatting 50 C# files:

  • FastFormat: ~0.7s
  • dotnet format: ~4.0s

That's roughly 6x faster.

Installation

dotnet tool install --global FastFormat

Usage

# Format files or directories
# (refuses to run on non-project directories without --force)
dotnet-fastformat src/
dotnet-fastformat Program.cs

# Check formatting without making changes
dotnet-fastformat --check src/

# Include/exclude patterns
dotnet-fastformat --exclude "**/*.generated.cs" src/
dotnet-fastformat --include "src/**/*.cs" --include "tests/**/*.cs" .

# Bypass the project-directory safety check
dotnet-fastformat --force ~/some-random-dir/

# Stdin -> stdout
cat Program.cs | dotnet-fastformat
cat Program.cs | dotnet-fastformat --stdin-filepath src/Program.cs

# Verbose output
dotnet-fastformat -v src/

# Control parallelism
dotnet-fastformat -p 8 src/

Supported .editorconfig Options

  • indent_style
  • indent_size
  • tab_width
  • end_of_line
  • insert_final_newline
  • trim_trailing_whitespace
  • csharp_new_line_before_open_brace
  • csharp_new_line_before_catch
  • csharp_new_line_before_else
  • csharp_new_line_before_finally
  • csharp_new_line_before_members_in_object_initializers
  • csharp_new_line_between_query_expression_clauses
  • dotnet_sort_system_directives_first
  • dotnet_separate_import_directive_groups

File Types

  • .cs — C# source files
  • .csx — C# script files

Safety

When run on a directory, FastFormat refuses to recurse unless the directory (or an ancestor) looks like a project — indicated by the presence of .git, .editorconfig, *.csproj, *.sln, or *.slnx. It also refuses to run directly on $HOME or the filesystem root. Use --force to bypass this check.

Encoding

Files are read and written preserving their existing BOM. Files without a BOM are assumed to be UTF-8.

Default Behaviors

  • Final newline: Files are always given a trailing newline unless .editorconfig explicitly sets insert_final_newline = false.

Why is it faster?

  • No MSBuild workspace loading
  • No semantic analysis
  • Parallel file processing
  • Direct .editorconfig parsing without heavy workspace machinery
  • Gitignore-aware file discovery
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.5.0 56 5/31/2026
1.4.0 51 5/31/2026
1.3.1 67 5/31/2026
1.2.2 58 5/31/2026
1.2.1 61 5/31/2026
1.2.0 56 5/31/2026
1.1.0 50 5/31/2026
1.0.1 61 5/31/2026
1.0.0 54 5/31/2026