Free Online Go Playground
Write Go code and run it, with the output shown in a console. Your code is sent to a free online service to be compiled and run.
Press Run, or Ctrl or Cmd + Enter, to run your code. The output is shown in Console. Go runs on a remote server, so it needs a connection, can be busy, and can take half a minute to answer. It stops after 90 seconds. Input is not available.
Preview
Console
Output appears here. Press Run, then try console.log("Hello")
As with any online tool, we highly recommend not including sensitive data in your code, such as passwords, API keys or other secrets.
How to use
Write your program in main.go. It needs package main and a func main.
Press Run, or Ctrl or Cmd + Enter. The output appears in the Console panel.
Read any compiler message in the console: Go refuses to build a program with an unused import or an unused local variable.
Keep test data in the code, because the program cannot read keyboard input.
Download a zip with your source file and a page that records the last output.
Why use this tool
A recent Go release
The newest released Go version the service lists is chosen at each run, and its name is shown with the result.
Standard library
Packages such as fmt, strings, sort and sync can be imported.
Starter program
The example shows methods, interfaces, maps, slices and goroutines.
About this tool
Write a Go program in the browser and run it without installing the Go tools. The editor opens with a working example that uses an interface, a map with sorted keys and goroutines joined by a sync.WaitGroup, so you can change something and see what happens. Go cannot run inside this page, so when you press Run your code is sent to a free online code-running service, which compiles it and returns the output. Never paste passwords, API keys or other secrets.
Frequently asked questions
Yes. When you press Run, your code is sent from your browser to Wandbox (wandbox.org), a free community service that runs it and sends back the output. Like any website, it also receives your IP address. Do not include passwords, API keys, private data or other secrets.
Go treats an unused local variable or an unused import as a compile error. Remove it, or assign the variable to the blank identifier _ while you are experimenting.
No. Only the packages that come with Go are available. There is no go.mod file and modules cannot be downloaded.
Yes. The program runs as a normal Go program, so you can start goroutines, use channels and wait with sync.WaitGroup. The order of output from separate goroutines can change between runs.
It can take up to half a minute, depending on how busy the service is. The playground stops waiting after 90 seconds. If the service cannot be reached, try again later.