Graphics & Compute

WebAssembly

Probing…

WebAssembly is a web platform capability in the Graphics & Compute category. Near-native execution of compiled code. Supported in Chromium 57+, Firefox 52+, and Safari 11+.

Try it

Loading demo…

Code

// bytes of a module exporting add(i32, i32) -> i32
const bytes = new Uint8Array([
  0x00,0x61,0x73,0x6d, 0x01,0x00,0x00,0x00,
  0x01,0x07,0x01,0x60,0x02,0x7f,0x7f,0x01,0x7f,
  0x03,0x02,0x01,0x00,
  0x07,0x07,0x01,0x03,0x61,0x64,0x64,0x00,0x00,
  0x0a,0x09,0x01,0x07,0x00,0x20,0x00,0x20,0x01,0x6a,0x0b,
])
const { instance } = await WebAssembly.instantiate(bytes)
const add = instance.exports.add
add(19, 23) // => 42

Browser support

Chromium
57
Firefox
52
Safari
11

Frequently asked questions

Which browsers support WebAssembly?

Supported in Chromium 57+, Firefox 52+, and Safari 11+.

Does WebAssembly require HTTPS?

No. WebAssembly works without a secure context, though serving your site over HTTPS is always recommended.

What is WebAssembly used for?

Near-native execution of compiled code.

Can I try WebAssembly in my browser?

Yes. shwcs.net runs a live WebAssembly demo that probes your current browser and lets you try the API. Everything runs locally — nothing is sent anywhere.

MDN reference ↗ Specification ↗