Was ist das WASM-Dateiformat?
Eine .wasm-Datei ist ein kompiliertes WebAssembly-Modul: portabler binärer Bytecode für eine stapelbasierte virtuelle Maschine. Entwickler schreiben Code in C, C++, Rust, Go oder einer anderen unterstützten Sprache und kompilieren ihn zu .wasm, damit er mit nahezu nativer Geschwindigkeit läuft. Im Web läuft das Modul neben JavaScript; der Browser ruft es ab und führt es in einer Sandbox ohne direkten Zugriff auf Ihr System aus.
WebAssembly ist ein offener Standard der W3C WebAssembly Working Group, der im März 2017 erstmals stabil war und seit Dezember 2019 eine W3C-Empfehlung ist. Jedes Modul beginnt mit dem 8-Byte-Header 00 61 73 6D 01 00 00 00 (der String \0asm plus ein Versionsfeld), gefolgt von nummerierten Abschnitten für Typen, Importe, Funktionen, Speicher, Exporte und den Code. Das lesbare Text-Gegenstück ist das .wat-Format.
Sicherheit
RISIKO: MEDIUMWebAssembly runs inside a sandbox with no direct access to the file system, network, or DOM unless the host grants it, so a module cannot escape on its own. The risk comes from what the surrounding page or runtime allows: malicious sites have used Wasm for in-browser cryptomining and for obfuscating logic that is harder to read than JavaScript. Only run standalone .wasm files from sources you trust, since a WASI runtime can be given file and network permissions.
Formatdetails
kurz gefasst- Wavefront / general 3D scene data - A few older or niche 3D and simulation tools have used .wasm for scene or mesh data, unrelated to WebAssembly.
- Application-specific save or cache files - Some standalone programs have reused the .wasm extension for internal data files; these are not WebAssembly modules and lack the \0asm header.
Programme zum Öffnen von WASM-Dateien
.wasm served by a page and shows the disassembled module in the Debugger panel. .wasm modules automatically when a web page instantiates them; DevTools can disassemble and debug them. wasm2wat file.wasm -o file.wat to disassemble the binary into readable text; wasm-objdump prints section details. wasm2wat file.wasm; installable via Homebrew. wasm2wat file.wasm or dump sections with wasm-objdump -x file.wasm. Technische Details
technische Spezifikation| Encoding | Binary bytecode (stack-machine instructions) |
| Byte order | Little-endian for multi-byte scalars; LEB128 for integers |
| Container | Module = 8-byte header followed by a sequence of numbered sections |
| Compression | None built in; commonly served with gzip or Brotli over HTTP |
| Typical size | Tens of KB to several MB depending on the compiled program |
| Structure | Header (magic + version) then sections: Type, Import, Function, Table, Memory, Global, Export, Start, Element, Code, Data, plus optional Custom sections (names, DWARF debug info). |
| Integrity | No internal checksum; integrity handled by transport (HTTPS) or Subresource Integrity on the web |
| Platforms | Windows, macOS, Linux, Android, iOS, Web |
| Initial Release Full | March 2017 (MVP / binary format version 1) |
| Notes | Text-format counterpart is the .wat file. Source languages such as C, C++, Rust and Go compile to .wasm. Runs sandboxed in browsers and in standalone runtimes (Wasmtime, Wasmer, WasmEdge, WAMR). WASI extends it to server and CLI use. |
| Instruction Set | Virtual stack machine, structured control flow, 32/64-bit integers and floats, linear memory |
| Debug Info | Optional DWARF data and a name section carried in Custom sections |
| Veröffentlicht | 2017 |
| Neueste Version | WebAssembly 3.0 (2025); binary version field 0x01 |
| Offener Standard | Ja · lizenzgebührenfrei |
| Spezifikation | webassembly.github.io |
WASM-Konvertierungen
Community Q&A
von Nutzern gefragtNoch keine Fragen - stellen Sie die erste Frage zu WASM-Dateien.
Häufig gestellte Fragen
Wie öffne ich eine WASM-Datei?
wasm2wat file.wasm von WABT in Text oder führen Sie sie außerhalb eines Browsers mit Wasmtime oder Wasmer aus.Kann ich eine WASM-Datei bearbeiten?
wasm2wat in das Textformat .wat, bearbeiten Sie dieses und setzen Sie es mit wat2wasm wieder zusammen. Für echte Änderungen bearbeiten Sie normalerweise den ursprünglichen C-, C++- oder Rust-Quellcode und kompilieren ihn neu.Was ist der Unterschied zwischen .wasm und .wat?
.wasm ist die kompakte Binärdatei, die eine Maschine ausführt; .wat ist der entsprechende menschenlesbare Text (WebAssembly Text Format). Sie lassen sich mit WABT verlustfrei hin- und herkonvertieren.Warum lädt mein Browser eine .wasm-Datei herunter, anstatt sie auszuführen?
.wasm mit dem MIME-Typ application/wasm senden. Wenn sie als generischer Typ oder Texttyp bereitgestellt wird, lädt der Browser sie möglicherweise herunter oder verweigert das Stream-Compiling. Korrigieren Sie den Content-Type des Servers.Ist eine WASM-Datei sicher auszuführen?
Welche Programme erstellen WASM-Dateien?
wasm32 mit wasm-pack, TinyGo/Go und Clang/LLVM erzeugen .wasm-Ausgaben.