← All benchmarksGo

Go hello world binary size: 2.0 MB, 1.4 MB stripped, 1.2 MB for Linux

How big is a Go hello world binary?

A default go build produced a 2.0 MB binary, -ldflags="-s -w" reduced it to 1.4 MB, and cross-compiling for linux/amd64 with the same flags produced a 1.2 MB statically linked executable.

Results

go build2.0 MB
-ldflags="-s -w"1.4 MB
GOOS=linux GOARCH=amd64 + strip1.2 MB (static)

How it was measured

Hello world with fmt.Println, Go 1.22.

go build -ldflags="-s -w" -o app ./cmd/app

Why

Go links the runtime and standard library statically, and stripping removes symbol tables and debug info.

When this does not apply

Real services are larger; hello world is a floor.

Environment

MacBook Air (Apple silicon, 8 cores), macOS, Go 1.22. Measured 2026-10-12.

Source: shorts/demo-ticket/go/hello/main.go in my content-engine repository. Treat any single run as a direction; re-run it on your hardware.

By Josué Barros, senior software engineer (full-stack, data and AI).