C# Formatter

Format C# code with consistent indentation and brace style.

C# Formatter

.cs

Paste text or open a file to see the result.

What it does

Formats C# with the same indentation and brace placement in the whole file. Handy when you tidy a snippet before sharing it or read code written in another style. Only the layout changes, not what the code does.

About the .cs format

.CS file extension
File Type
Visual C# Source Code File
Developer
Microsoft
MIME
text/plain

A .CS file extension is a Visual C Source Code File. This compiled code is generated by the Microsoft C compiler.

C# Formatter questions

How do I use the C# Formatter?

Paste the text into the Input box or open a file, set the options, then copy or download the result.

Does renaming a file to .cs change its format?

No. The extension only tells programs what to expect, and the content of the file stays the same. To change the format, convert the file. The .cs page lists programs and converters for it.