.C

C File

C Source Code File
Ask a question
QUICK ANSWER

A .c file is C source code - plain text that a programmer writes, which a compiler turns into a runnable program. Open it for reading in any text editor (Notepad++, VS Code, Vim). To compile and run it, install GCC, Clang, or Visual Studio and run a one-line build command. The file itself is safe to view; the risk comes only if you compile and run unknown code.

Developer: Dennis Ritchie / Bell Labs (C language); standardized by ISO/IEC (ANSI C) Category: Developer Files Open standard MIME: text/x-csrc
OPENS ON Windows macOS Linux
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Jul 28, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the C file format?

.c is a source code file for the C programming language. C is a general-purpose, procedural language and is considered a mid-level programming language widely used for the development of software applications, operating systems, and embedded systems. Created by Dennis Ritchie at Bell Labs in 1972, it has been standardized by ANSI and ISO through several revisions - the current standard is C23.

Files with a .c extension are accessible with text editors and a user can read or write the code in these files through simple text editor software or a full IDE. The .c file contains actual code written by the developer along with other information such as preprocessor directives (like #include and #define) and comments. Before running, a .c file must be compiled by a C compiler such as gcc or clang into an object file and then linked into an executable.

.c files are specific to the C language and should not be confused with C++ source files, which use extensions like .cpp or .cc. Declarations shared between multiple .c files are placed in header files with a .h extension.

Security & safety

RISK: LOW

A .c file is plain text and cannot run on its own, so opening one in an editor is safe. The risk appears only when you COMPILE and RUN unknown C code: source from an untrusted source can do anything a program can once built (delete files, network access, install malware), and C's low-level nature makes malicious or buggy code easy to hide. Read code before compiling it, build untrusted code in a sandbox/VM, and never run a compiled binary you don't trust. The file extension itself carries no exploit - the danger is in what the code does after compilation.

Format details

in a nutshell
FULL NAMEC Source Code File
DEVELOPERDennis Ritchie / Bell Labs (C language); standardized by ISO/IEC (ANSI C)since C language created 1972 (Bell Labs); standardized ANSI C 1989, ISO C 1990, latest C23
MIME TYPEtext/x-csrc
TYPEPlain-text programming source code (C language)
STANDARDOpen · royalty-free
This extension is also used by…
  • C++ source file (legacy) - Historically .c (and uppercase .C on case-sensitive Unix) was also used for C++ source, the meaning in this DB's 'C/C++' name; modern C++ uses .cpp/.cc/.cxx.
  • DOS/Windows volume-letter or generic data - Rarely, 'c' appears as a non-source artifact (e.g. a stray single-letter name); the source-code meaning dominates overwhelmingly.

Programs that open C files

Windows4 apps
Microsoft Visual Studio Freemium Open or add the .c to a C/C++ project and press Build/Run; the free Community edition includes the MSVC compiler.
Notepad Open-source Open the .c to read/edit the code with C syntax highlighting (viewing/editing only - no compiler).
Visual Studio Code Free Open the .c for syntax-highlighted editing; add the C/C++ extension + a compiler (MSVC or MinGW GCC) to build and debug.
MinGW-w64 / GCC Open-source Command line: 'gcc hello.c -o hello.exe' then run hello.exe. The standard free Windows C compiler.
macOS2 apps
Xcode (Apple Clang) Free Open in Xcode, or use the bundled Clang from Terminal: 'clang hello.c -o hello && ./hello'.
Visual Studio Code Free Edit the .c with the C/C++ extension; compile with the Clang command-line tools installed via Xcode.
Linux3 apps
GCC (GNU Compiler Collection) Open-source Compile from a terminal: 'gcc hello.c -o hello && ./hello'. Pre-installed or one package away on every distro.
Vim / GNU Emacs Open-source Open the .c in the terminal editor to read/edit with C highlighting; pair with gcc/make to build.
Visual Studio Code Free Cross-platform editor with the C/C++ extension; edits, builds (via gcc/clang) and debugs .c files.

Technical details

deep spec
MIME typetext/x-csrc
Character encodingPlain ASCII or UTF-8; no binary magic-byte signature - identified by content, not bytes
Language standardStandardized as ANSI C89, then C99, C11, C17; current standard is C23 (ISO/IEC 9899:2024)
Programming paradigmProcedural and imperative; does not support classes or objects natively
Memory managementManual - developer allocates and frees heap memory using malloc() and free()
Preprocessing stageSource is processed by a preprocessor before compilation, resolving #include, #define, and conditional compilation directives
Compilation outputCompiled to an object file (.o / .obj), then linked into an executable or static/shared library
Header pairingImplementation logic lives in .c files; declarations shared across translation units go in paired .h header files
Primary applicationsOS kernels, embedded firmware, compilers, databases, and performance-critical system software
Comment syntaxBlock comments /* ... */ supported since C89; single-line // comments added in C99
PortabilityISO-conforming code is highly portable across architectures; platform differences managed with preprocessor guards
Case-sensitivity distinctionOn case-sensitive filesystems (Linux, macOS), uppercase .C conventionally denotes a C++ source file, distinct from lowercase .c
Compiler ecosystemCompiled by GCC, Clang/LLVM, MSVC, Intel oneAPI C++, and TinyCC among others
ReleasedC language created 1972 (Bell Labs); standardized ANSI C 1989, ISO C 1990, latest C23
Open standardYes · royalty-free
Specificationwww.iso.org

C conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with C files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about C files.

Frequently asked questions

How do I open a .c file?
To read or edit it, open it in any text editor - Notepad++, VS Code, Vim or Xcode give syntax highlighting. It's just text, so even Notepad works for viewing.
How do I compile and run a .c file?
Install a C compiler and run it on the file. On Windows: 'gcc hello.c -o hello.exe' (MinGW) then run hello.exe, or build in Visual Studio. On macOS/Linux: 'gcc hello.c -o hello && ./hello'.
How do I turn a .c file into an .exe?
You compile it, not convert it. With GCC: 'gcc program.c -o program.exe'. In Visual Studio, add the .c to a project and press Build - the .exe is the compiler's output.
What's the difference between a .c and a .h file?
A .c file contains the actual code (definitions); a .h header file contains declarations (function prototypes, types, macros) shared across .c files via #include. You compile .c files, not .h files.
Is a .c file C or C++?
.c normally means C source; C++ uses .cpp/.cc/.cxx. Some old Unix code used .c for C++ too (with uppercase .C), which is why this is sometimes labelled 'C/C++'. Compilers choose the language from the extension.
Can I open a .c file on my phone?
Yes for reading - any text/code editor app opens it. To compile on a phone you'd need a mobile C IDE or a remote/online compiler; phones aren't a typical C build environment.

References

1ISO/IEC - C programming language standard (C23)www.iso.org
2GCC - GNU Compiler Collection (official)gcc.gnu.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.BINCD/DVD Disc Image (BIN/CUE)
3.MDMarkdown Document
4.RPMSGRestricted Permission Message
5.PARTPartial Download File
6.CRDOWNLOADChrome Partial Download File
7.NOMEDIAAndroid No-Media Marker File
8.PRDXSoftMaker Presentations Document
9.SWFSmall Web Format (Shockwave Flash)
10.PRO6XProPresenter 6 Bundle File

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z