# WebAssembly (Wasm)

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/2026.3/llms.txt).

WebAssembly (Wasm) is a binary format that you can run in a browser. GoLand supports generating WASM files from GO source files. To learn more, refer to the [official WebAssembly documentation](https://webassembly.org/).

Procedure: Create a Go project

1. Select `File | New | Project…`.

Alternatively, navigate to New | Project on the Welcome to GoLand dialog.

2. In the New Project dialog, select Go from the list of available project types.

3. In the GOROOT field, specify the location of your Go installation. GoLand usually detects this location automatically.

To change or install a new Go SDK version, click Add SDK and choose one of the following options:

* Local: to use an existing SDK from your local system.

* Download: to download a Go SDK version from the official repository.

Procedure: Configure the project for generating WASM files

1. Open settings `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Comma` (VSCode), `⌘ Comma` (VSCode (macOS)), and navigate to `Go | Build Tags`.

2. From the OS list, select js.

3. From the Arch list, select wasm.

4. Click OK.

5. On the main toolbar, click `Run | Edit Configurations`.

6. Click the Add New Configuration icon (![The Add New Configuration icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.add.svg)) or press `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Ctrl+N` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (VSCode), `⌃ ⏎` (VSCode (macOS)).

7. From the Run kind list, select File.

8. In the Files field, add the name of the GO file you want to run (for example, `main.go`).

9. Clear the Run after build checkbox.

10. In the Environment field, click the Browse button at the end of the field.

In the Environment Variables dialog, add the following environment variables:

* `GOOS=js`

* `GOARCH=wasm`

11. In the Go tool arguments field, enter `-o main.wasm`, where `main.wasm` is the name of the output WASM file. If the field contains `-i`, remove it.

12. Click OK.

13. Click the Run <configuration_name> icon or press `Shift+F10` (Windows), `⌃ R` (macOS), `⇧ F10` (IntelliJ IDEA Classic (macOS)), `⌥ ⇧ R` (macOS System Shortcuts), `Shift+F10` (XWin), `Shift+F10` (GNOME), `Shift+F10` (KDE), `Shift+F10` (Emacs), `Shift+F10` (Sublime Text), `Shift+F10` (Sublime Text (macOS)), `Ctrl+F5` (VSCode), `⌃ F5` (VSCode (macOS)).

As a result, a new WASM file appears in the Project tool window.

[Video](https://resources.jetbrains.com/help/img/idea/2026.3/go_create_wasm_project.mp4)

> **Tip:**
> To add an environment variable, click the Add icon. Enter the variable name in the Name column and its value in the Value column.

