Zig Online Compiler

About the Zig compiler

A modern C alternative. Compiled online. Run Zig code in your browser with no install and no signup — the editor, the input and the output share one screen. Zig is executed by a remote runtime: your code is submitted to it and the output is returned to this page.

Press Run to execute the program, edit it and press Run again, or paste your own code over it. Everything you type stays in the page; the editor caches your work locally so a reload does not lose it.

A Zig example

This is the program the Zig editor opens with — run it as it is, then change it.

const std = @import("std");
pub fn main() !void {
    // Zig 0.15 replaced std.io.getStdOut with std.fs.File.stdout, and the own
    // runner carries the older compiler. The comptime check keeps this one
    // program valid on both, which is what the fallback chain needs.
    if (@hasDecl(std.fs.File, "stdout")) {
        var buf: [256]u8 = undefined;
        var stdout = std.fs.File.stdout().writer(&buf);
        try stdout.interface.print("Hello, World!\n", .{});
        try stdout.interface.flush();
    } else {
        try std.io.getStdOut().writer().print("Hello, World!\n", .{});
    }
}

More Systems & Low-Level compilers

Browse all 109 languages — the same editor runs each of them, in the browser or on a shared runner.