RUN

C Online Compiler

Write, compile and run C in your browser. Free, no sign-up.

main.c

// Welcome to the CodingHumans C compiler.
// Press Run (or Ctrl + Enter). Your program asks for input in the output panel.

#include <stdio.h>

int main(void) {
    char name[50];
    int n;

    printf("What's your name? ");
    scanf("%49s", name);
    printf("Pick a number: ");
    scanf("%d", &n);

    printf("Hello, %s! The squares up to %d are:\n", name, n);
    for (int i = 1; i <= n; i++) {
        printf("%d ", i * i);
    }
    printf("\n");
    return 0;
}
Output

Press Run to see the output.

C examples to try

How to run C online

  1. Write or paste your C code in the editor.
  2. Press Run, or Ctrl + Enter (Cmd + Enter on a Mac).
  3. If your program reads input, type it in the output panel and press Enter.
  4. Press Share to copy a short link to your code. Anyone who opens it sees exactly what you wrote.

About this C compiler

This free C compiler uses Clang, a real C compiler, running inside your browser. Your program is compiled to WebAssembly and runs on your own computer, so there are no queues and no run limits. It compiles as C17 with optimisations on.

scanf, getchar and fgets wait for you to type in the output panel while your program runs, like a real terminal. printf, the math library, malloc and free, structs and pointers all work.

Errors and warnings come straight from the compiler, with the line and column. If your program crashes, for example by reading past the end of an array, you see a plain explanation instead of a silent failure. Press Stop to end a program that never finishes.

Frequently asked questions

›Is this C compiler free?

Yes. It is free with no sign-up and no run limits. The compiler runs in your own browser, which is what keeps it free.

›Which compiler and C version is it?

Clang 22, compiling C17 with -O2. Code written for GCC compiles here too, as long as it sticks to standard C.

›Does scanf work?

Yes. When your program reads input, the output panel waits for you to type a line and press Enter. You can also type all the input in advance.

›Why is the first run slow?

The first time, your browser downloads the compiler (about 27 MB). It is cached after that, so later runs compile in well under a second.

›What can’t it do?

Your program runs in a sandbox: there are no files, no network and no threads. Headers from other systems, such as conio.h or windows.h, are not available.