Online Go compiler
Run Go code online free, no sign-up: write package main, give it input on stdin and see the output, compiler errors and run time in your browser.
How do I run Go code online?
This is an online Go (Golang) compiler: write package main with a func main(), put its input in the Input box and press Run. It is compiled and run on the server, and you see the output, the compiler's errors or the panic and its trace, and the run time — free, with no sign-up.
How it works
- Write your program. A Go program is package main with a func main(). Every import must be used and every declared variable read, or it does not compile — Go treats both as errors, not warnings.
- Give it input. fmt.Scan(&n) reads whitespace-separated values into variables. For lines, wrap stdin in bufio.NewScanner(os.Stdin) and call Scan() and Text(); for large input bufio.NewReader(os.Stdin) with fmt.Fscan is much faster. Put every line the program reads in the Input box before you run it.
- Run it. Press Run or Ctrl+Enter. You get what the program printed, any compiler or runtime error, and how long it ran. The first run without an account asks a quick check that you are a person.
Who it is for
Anyone writing Go who wants it run now: a student checking a lab program or an exam answer, someone on a machine where nothing can be installed, or a learner trying Go before setting it up.