About this C compiler
This free online C compiler lets you write, compile and run C programs without installing anything. Type your code, press Run, and the program's output appears next to the editor.
The code is compiled to WebAssembly by a C compiler running inside your browser, so there is no account to create and your program is not sent to a server. It is handy for homework, for practising pointers and loops, or for checking how a library function behaves.
How to use it
- Write or paste your C program in the editor. It needs a main function.
- If your program reads input with scanf, fgets or getchar, type the values in the Input box below the output, one per line, in the order the program asks for them.
- Press Run (or Ctrl + Enter). The first run downloads the compiler (about 19 MB, saved by your browser afterwards), so it takes longer than later runs.
- Compiler errors and warnings show the file line number so you can fix them, and your program's output follows.
Features
- Compiles C (GNU C11) with clang, entirely in your browser
- Standard library including stdio, stdlib, string and math
- Input through the Input box, read with scanf, fgets or getchar
- Clear compiler errors and warnings with line numbers
- No login, no install, works on any modern device
- Dark and light themes, automatic saving, download as .c
Good to know
- Programs run in a sandbox without a file system, network or threads.
- Input is given before the program starts, not typed while it runs.
- A program that runs for more than 30 seconds is stopped.
- long double maths is not supported. Use double instead. On this platform long is 32 bits, so use long long for big numbers.
- A program can use up to 256 MB of memory. Threads and std::atomic are not available.
- This compiler is clang 8 targeting WebAssembly, so a few newer language features and compiler-specific extensions may be missing.
Frequently asked questions
Does this C compiler need an internet connection?
You need a connection the first time to download the compiler. After that your browser keeps it, and compiling and running happen on your own device.
How do I give my C program input?
Type the values into the Input box below the output, one per line, then press Run. scanf, fgets and getchar read from it.
Which version of C is used?
GNU C11, compiled with clang. Standard C99 and C11 code works as expected.
Why is the first run slow?
The compiler itself is downloaded and prepared on the first run. Later runs on the same device are much faster because the files are already cached.
Is it free?
Yes. There is no sign-up, and nothing is executed on our servers.