Hello, World!
#include <stdio.h>
int main(void) {
printf("Hello, World!\n");
return 0;
}Tap Run to execute
main.c · output appears here
Press Run to execute
Output streams here as your program runs.
C is a statically typed, procedural systems programming language created by Dennis Ritchie at Bell Labs in the early 1970s. Designed for efficiency and close control over memory and hardware, it provides pointers, manual memory management, and a small core language paired with a standard library. C heavily influenced the syntax of countless later languages and remains a foundation of computing.
Today C is the language of operating system kernels, embedded systems, device drivers, and performance-critical libraries. Its portability and minimal runtime make it ideal where predictability and speed matter. CompileBytes builds main.c with GCC 15.3 in GNU C23 mode inside an isolated hosted sandbox, so you can use modern C features, pointers, structs, and the standard library without installing a toolchain.
main.c is the entry point. Add helper files from the explorer and import them into your project.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
main.c includes a header containing a small inline helper.
#include <stdio.h>
#include "helper.h"
int main(void) {
printf("%d\n", answer());
return 0;
}
#ifndef HELPER_H
#define HELPER_H
static inline int answer(void) { return 42; }
#endif
#include <stdio.h>
int main(void) {
printf("Hello, World!\n");
return 0;
}#include <stdio.h>
int main(void) {
char name[100];
scanf("%99s", name);
printf("Hello, %s!\n", name);
return 0;
}#include <stdio.h>
int main(void) {
int nums[] = {10, 20, 30};
for (int i = 0; i < 3; i++) {
printf("%d\n", nums[i]);
}
return 0;
}#include <stdio.h>
long factorial(int n) {
return n <= 1 ? 1 : n * factorial(n - 1);
}
int main(void) {
printf("%ld\n", factorial(5));
return 0;
}#include <stdio.h>
#include <string.h>
int main(void) {
char s[] = "Hello, World";
printf("length: %zu\n", strlen(s));
char copy[64];
strcpy(copy, s);
printf("%s\n", copy);
return 0;
}#include <stdio.h>
struct Point {
int x, y;
};
int main(void) {
struct Point p = {3, 4};
printf("(%d, %d)\n", p.x, p.y);
return 0;
}#include <stdio.h>
#include <stdlib.h>
int cmp(const void *a, const void *b) {
const int lhs = *(const int *)a;
const int rhs = *(const int *)b;
return (lhs > rhs) - (lhs < rhs);
}
int main(void) {
int nums[] = {3, 1, 2};
qsort(nums, 3, sizeof(int), cmp);
for (int i = 0; i < 3; i++) printf("%d ", nums[i]);
printf("\n");
return 0;
}#include <stdio.h>
#include <stdlib.h>
int main(void) {
int n = 3;
int *arr = malloc(n * sizeof *arr);
if (arr == NULL) return 1;
for (int i = 0; i < n; i++) arr[i] = i * i;
for (int i = 0; i < n; i++) printf("%d\n", arr[i]);
free(arr);
return 0;
}#include <stdio.h>
void swap(int *a, int *b) {
int t = *a;
*a = *b;
*b = t;
}
int main(void) {
int x = 1, y = 2;
swap(&x, &y);
printf("%d %d\n", x, y);
return 0;
}#include <stdio.h>
int main(void) {
int n, sum = 0;
while (scanf("%d", &n) == 1) {
sum += n;
}
printf("Sum: %d\n", sum);
return 0;
}The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Type or paste your code into the editor, then click Run (or press Ctrl/Cmd + Enter) to execute it.
Output streams into the console panel, including runtime errors, exit status, and execution time.
Nothing to install and no account to create — code runs in an isolated hosted runtime.
Language-aware autocomplete and IntelliSense suggestions where the editor has a matching language service
Syntax highlighting, with native compiler and runtime errors shown in the console
Bracket matching, auto-indentation, code folding, and a minimap
Multi-cursor editing plus find & replace (Ctrl/Cmd + F)
Full undo/redo history and copy to clipboard
Built on Monaco — the same editor that powers VS Code
Run on demand, or turn on Auto-run to execute on every change
Stop long-running or infinite programs at any time
A real console shows standard output, errors, exit status, and execution time
Pass standard input (stdin) to your program from the Input panel — one value per line
Switch between light and dark themes
Adjust font size and other editor settings
Toggle side-by-side or top/bottom layouts
Enter distraction-free fullscreen mode
Generate a shareable link to your exact code in one click — no login needed
Your work autosaves to your browser, so you can pick up where you left off
Copy the active file to your clipboard
Run code: Ctrl/Cmd + Enter
Find & replace: Ctrl/Cmd + F
Open the full shortcut list from the keyboard icon in the toolbar
C is one of 23 linked-project compilers. Run always starts main.c; selecting a helper tab changes what you edit, not the entry file.
main.c includes a header containing a small inline helper.
Linked-project languages (23): Node.js, TypeScript, Deno, Python, C, Go, Dart, Swift, Rust, Ruby, PHP, Java, Kotlin, C++, C#, Nim, Crystal, Haxe, Zig, Scala, D, Bun, Objective-C.
Single-file scratchpads (46): Matplotlib, NumPy, pandas, Haskell, Clojure, Perl, Lua, Tcl, jq, Raku, Elixir, Bash, Zsh, Nushell, R, Assembly (NASM), Julia, Octave, Groovy, PowerShell, Visual Basic .NET, Odin, Pascal, Lisp, Erlang, CoffeeScript, COBOL, BASIC, V, Racket, OCaml, Prolog, AWK, Emacs Lisp, Emojicode, Forth, F#, Fortran, Assembly (NASM64), Solidity, Mojo, Ada, WASM (WAT), Gleam, Shell Script (sh), Scheme. Their extra project files are not submitted to the runtime.
Download project exports every C tab and a README in one ZIP archive.