tinygo-org /tinygo
Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
★ 17,915⑂ 1,110👁 183⑃ 4,242● 2,004▤ 54
+1
Daily
17,915
stars
1,110
forks
183
watchers
4,242
prs
2,004
issues
54
releases
README
TinyGo - Go compiler for small places
TinyGo is a Go compiler intended for use in small places such as microcontrollers, WebAssembly (wasm/wasi), and command-line tools.
It reuses libraries used by the Go language tools alongside LLVM to provide an alternative way to compile programs written in the Go programming language.
[!IMPORTANT]
You can help TinyGo with a financial contribution using OpenCollective. Please see https://opencollective.com/tinygo for more information. Thank you!
Embedded
Here is an example program that blinks the built-in LED when run directly on any supported board with onboard LED:
go
package main
import (
"machine"
"time"
)
func main() {
led := machine.LED
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
for {
led.Low()
time.Sleep(time.Millisecond 1000)
led.High()
time.Sleep(time.Millisecond 1000)
}
}
The above program can be compiled and run without modification on an Arduino Uno, an Adafruit Circuit Playground Express, a Seeed Studio XIAO-ESP32S3 or any of the many supported boards that have a built-in LED, just by setting the correct TinyGo compiler target. For example, this compiles and flashes an Arduino Uno:
shell
tinygo flash -target arduino-uno examples/blinky1
WebAssembly
TinyGo is very useful for compiling programs both for use in browsers (WASM) as well as for use on servers and other edge devices (WASI).
TinyGo programs can run in Fastly Compute, Fermyon Spin, wazero and many other WebAssembly runtimes.
Here is a small TinyGo program for use by a WASI host application:
go
package main
//go:wasmexport add
func add(x, y uint32) uint32 {
return x + y
}
This compiles the above TinyGo program for use on any WASI Preview 1 runtime:
shell
tinygo build -buildmode=c-shared -o add.wasm -target=wasip1 add.go
You can also use the same syntax as Go 1.24+:
shell
GOOS=wasip1 GOARCH=wasm tinygo build -buildmode=c-shared -o add.wasm add.go
Installation
See the getting started instructions for information on how to install TinyGo, as well as how to run the TinyGo compiler using our Docker container.
Supported targets
Embedded
You can compile TinyGo programs for over 150 different microcontroller boards.
Firmware output extensions depend on the target. For example, RP2040 and
RP2350 targets support .elf, .hex, and .uf2 firmware outputs.
For more information, please see https://tinygo.org/docs/reference/microcontrollers/
WebAssembly
TinyGo programs can be compiled for both WASM and WASI targets.
For more information, see https://tinygo.org/docs/guides/webassembly/
Operating Systems
You can also compile programs for Linux, macOS, and Windows targets.
For more information:
- Linux https://tinygo.org/docs/guides/linux/
- macOS https://tinygo.org/docs/guides/macos/
- Windows https://tinygo.org/docs/guides/windows/
Currently supported features:
For a description of currently supported Go language features, pleaTop issues
#1427ESP8266 WiFi support31 comments · 2020-10-07#2630Support for multi threading in WASM?27 comments · 2022-02-11#3733The new version has a memory leak22 comments · 2023-05-19#2641Tinygo wasm file bigger than from regular go?22 comments · 2022-02-16#4988sync.Mutex double-unlock panic with rp2 multi-core20 comments · 2025-08-08#3876[Question] Noticeable performance differences compared to C20 comments · 2023-08-19#2888Revisting 1157 - Adding delve support for TinyGo20 comments · 2022-06-02#4887Output to serial monitor is 'loosing' some characters (RP2350, maybe other platforms)18 comments · 2025-05-05
Discussions
#6270CI improvements0 comments · 2026-11-12#6164OpenDeviceDB for finding TinyGo support by board model0 comments · 2026-11-04#5768RFC: Revisit ESP SVD sourcing for device generation0 comments · 2026-09-27#5703Register writes aren't taking effect (ESP32 family)0 comments · 2026-09-18#5650Question about the open PR limit1 comments · 2026-09-03#5596tinygo-zed: make Zed’s gopls understand TinyGo targets0 comments · 2026-08-16#5540Tinygo.org website – multi-language translation button0 comments · 2026-07-21#5536TinyGo API Design: "Header" files1 comments · 2026-07-20
Latest release
0.44.0 v0.44.0 2026-10-28Mere weeks after our previous release, this new version brings massive performance boosts, improvements in toolchain support, and lots of new hardware. TinyGo now builds against LLVM 23 and drops support for LLVM versions below 15. The interp package now runs more of your program's initialization at compile time so startup is smaller and faster. The compiler skips slice bounds checks that cannot fail and avoids more byte slice copies in string comparisons. On the hardware side, the cores scheduler now supports the ESP32-S3 and adds core affinity for both it and the RP2040/RP2350. The ESP32-S3