How to open .WAT files on Windows

To open .WAT files on Windows, open the .wat file in a code editor (for example, Visual Studio Code) since it is plain text.

Step-by-step instructions

  1. Open the .wat file in a code editor (for example, Visual Studio Code) since it is plain text.
  2. If you need a runnable module, convert it to .wasm using a WebAssembly tool such as WABT’s wat2wasm.

Common issues

The file opens as unreadable or with the wrong app

.wat files are plain text, but the OS may associate the extension with an unrelated program or a non-text viewer.

  1. Open it explicitly in a code editor (e.g., VS Code) using File → Open.
  2. If needed, change the default app for .wat files to your preferred editor.

“It won’t run” because WAT is not the executable WebAssembly format

Browsers and runtimes typically load WebAssembly in the binary .wasm format; .wat is the text form used for authoring and inspection.

  1. Convert the .wat file to .wasm using wat2wasm (WABT) or equivalent tooling.
  2. Use the produced .wasm file in your WebAssembly workflow (for example, in a web project).

Conversion fails with parse/validation errors

wat-to-wasm conversion tools will reject WAT that does not match the expected text-format conventions or contains syntax errors.

  1. Check the file against WebAssembly text-format conventions and correct syntax issues.
  2. Try converting again with wat2wasm and fix the reported line/column errors.

Security note

.wat is human-readable source text, but it can describe a module that, once converted to .wasm and executed, performs potentially unsafe or unexpected computations within the limits of the runtime environment.

Back to .WAT extension page