How to open a .c file
Quick, free ways to open C on any system.
A .c file is a C Source File. If double-clicking does nothing, your computer simply does not have an app that reads C yet. Here is how to fix that on each operating system, using free software wherever possible.
Open a .c file step by step
- Confirm the file really is a .c. Drop it into the WhatFileType file identifier, which reads its signature without uploading anything.
- On Windows, open it with VS Code or Visual Studio.
- On Mac, use VS Code or Xcode.
- On Linux, try VS Code or vim.
- Still stuck? Convert the .c to exe (via a compiler), which opens more widely.
Best apps to open .c files
Windows
- VS Code
- Visual Studio
- any text editor
macOS
- VS Code
- Xcode
- any text editor
Linux
- VS Code
- vim
- gcc / clang
!
Before you open it: Caution. A .c file is program source. Compiling and running it executes its code, so review unfamiliar files first.
Frequently asked questions
Why can't I open my .c file?
Almost always because no installed app understands C. Install one of the apps above, or convert the file to a format your existing software already reads.
How do I compile a .c file?
Use a C compiler: gcc file.c -o program on Linux or Mac, then run ./program. On Windows, Visual Studio or MinGW does the same.
What is the difference between a .c and a .h file?
A .c file holds the actual code. A .h header declares the functions and types so other .c files can use them; headers are included, not compiled on their own.