Zig · online compiler

Run Zig online

Run Zig 0.13 / 0.14 online — no hidden control flow, no macros, real speed.

Available versions
Firecracker microVM live per-test verdicts multi-file compile

Zig is Andrew Kelley's take on a modern systems language: no hidden control flow, no macros, first-class error unions, and a comptime that replaces both templates and macros. Popular as a modern alternative to C.

ls-judge compiles Zig 0.13 and 0.14 inside a Firecracker microVM.

Starter code

What you get in Zig

Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.

zig
Zig 0.14
const std = @import("std");
pub fn main() !void {
    const stdin = std.io.getStdIn().reader();
    const stdout = std.io.getStdOut().writer();
    var buf: [64]u8 = undefined;
    const line = try stdin.readUntilDelimiter(&buf, '\n');
    const n = try std.fmt.parseInt(i64, std.mem.trim(u8, line, &std.ascii.whitespace), 10);
    try stdout.print("{d}\n", .{n * 2});
}
stdin →21
expected →42
FAQ

Common questions about Zig on ls-judge

Zig 0.13 or 0.14?
Both — pick from the version chip.
Zig package manager?
No network — bring source only.
Cross-compilation?
The compiler CAN cross-compile but here we build for the sandbox host.
Free?
Yes.
Further reading
Also try