C/C++ Formatter

Indent C and C++ source and header files.

C/C++ Formatter

.c · .h · .cpp

Paste text or open a file to see the result.

What it does

Indents C and C++ source and header files and evens out spacing around braces and operators. Useful for old code or snippets that mix tabs and spaces. You get the same code with a consistent layout.

About the .c format

.C file extension

.c C/C++ Source Code File

Developer Files

File Type
C/C++ Source Code File
Developer
Dennis Ritchie / Bell Labs
MIME
text/x-csrc

A C file is a text file that contains C/C++ source code. It uses the extension ".C" for this purpose.

Also works with

C/C++ Formatter questions

How do I use the C/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 .c 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 .c page lists programs and converters for it.