Online GNU C Compiler (GCC)

Online GNU C Compiler lets you write, compile and test C programs with GCC in your browser without installing a local Linux toolchain or MinGW setup. Supply standard input before running and inspect compiler diagnostics alongside program output.
Cloud Run sends source files and input to remote compilation services. Compiler versions, accepted flags and GNU extension support depend on the execution provider. Read the Privacy Policy before using Run, Share or optional AI, and avoid submitting confidential code.
GNU C dialects vs strict ISO C flags
By default, GCC compiles in a GNU C dialect (such as gnu11 or gnu17) rather than strict ISO C. When testing university coursework or portable systems code, check how your program behaves under both modes:
- GNU dialect flags (
-std=gnu99,-std=gnu11,-std=gnu17): enable ISO C features together with GNU C extensions such as statement expressions,typeofand__attribute__annotations where supported by the provider. - Strict ISO flags (
-std=c99,-std=c11,-std=c17with-pedantic-errors): reject non-standard extensions so your C program builds cleanly across compilers. Compare dialects in the C89/C99/C11/C17 compatibility checker and Clang vs GCC guide. - Diagnostic flags (
-Wall -Wextra): catch uninitialized variables, missing return statements andprintf/scanfformat mismatches before grading.
Runnable GNU C starter example
#include <stdio.h>
int main(void) {
int values[] = {4, 8, 15, 16, 23, 42};
size_t count = sizeof(values) / sizeof(values[0]);
int sum = 0;
for (size_t i = 0; i < count; i++) {
sum += values[i];
}
printf("Elements: %zu, Sum: %d\n", count, sum);
return 0;
}
Related C compiler tools
Switch to the main online C compiler, Dev C online compiler, multi-file C IDE, C++ compiler, or Turbo C migration guide, or look up diagnostics in C error fixes.
Online GNU C compiler FAQ
Is this online GNU C compiler free?
Yes. You can write, compile and run C programs with GCC in your browser for free with no installation or account.
What is the difference between -std=c11 and -std=gnu11?
Flags such as -std=c11 or -std=c17 select strict ISO C, whereas -std=gnu11 or -std=gnu17 enable GNU C extensions supported by GCC. Accepted flags depend on the active execution provider.
Can I pass GCC warning flags like -Wall and -Wextra?
Yes, allowlisted compiler options such as -Wall, -Wextra and -pedantic-errors can be passed in compiler settings when supported by the provider runtime.
How do I supply stdin input to scanf or fgets?
Open the Stdin tab and enter every number or line of text before clicking Run.
Does math.h work in the online GNU compiler?
Yes. Include math.h in your source file to call functions such as sqrt, pow and sin.