¿Qué es el formato de archivo WASM?
Un archivo .wasm es un módulo de WebAssembly compilado: código de bytes binario portátil para una máquina virtual basada en pila. Los desarrolladores escriben código en C, C++, Rust, Go u otro lenguaje compatible y lo compilan a .wasm para que se ejecute a una velocidad cercana a la nativa. En la web, el módulo se ejecuta junto con JavaScript; el navegador lo recupera y lo ejecuta en un entorno aislado (sandbox) sin acceso directo a su sistema.
WebAssembly es un estándar abierto del W3C WebAssembly Working Group, cuya primera versión estable fue en marzo de 2017 y es una Recomendación del W3C desde diciembre de 2019. Cada módulo comienza con el encabezado de 8 bytes 00 61 73 6D 01 00 00 00 (la cadena \0asm más un campo de versión), seguido de secciones numeradas para tipos, importaciones, funciones, memoria, exportaciones y el código. La contraparte de texto legible es el formato .wat.
Seguridad y protección
RIESGO: 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.
Detalles del formato
en pocas palabras- 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.
Programas que abren archivos WASM
.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. .wasm module with wasmer run file.wasm, including WASI programs. wasm2wat file.wasm; installable via Homebrew. wasm2wat file.wasm or dump sections with wasm-objdump -x file.wasm. Detalles técnicos
especificación profunda| 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 |
| Lanzado | 2017 |
| Última versión | WebAssembly 3.0 (2025); binary version field 0x01 |
| Estándar abierto | Sí · libre de regalías |
| Especificación | webassembly.github.io |
Conversiones de WASM
Preguntas y respuestas de la comunidad
preguntado por usuariosAún no hay preguntas; sea el primero en preguntar sobre los archivos WASM.
Preguntas frecuentes
¿Cómo abro un archivo WASM?
wasm2wat file.wasm de WABT, o ejecútelo fuera de un navegador con Wasmtime o Wasmer.¿Puedo editar un archivo WASM?
.wat con wasm2wat, edítelo y luego vuelva a ensamblarlo con wat2wasm. Para cambios reales, normalmente se edita el código fuente original en C, C++ o Rust y se vuelve a compilar.¿Cuál es la diferencia entre .wasm y .wat?
.wasm es el binario compacto que ejecuta una máquina; .wat es el texto equivalente legible por humanos (WebAssembly Text Format). Se pueden convertir de uno a otro sin pérdidas con WABT.¿Por qué mi navegador descarga un archivo .wasm en lugar de ejecutarlo?
.wasm con el tipo MIME application/wasm. Si se sirve como un tipo genérico o de texto, el navegador puede descargarlo o negarse a compilarlo en flujo. Corrija el tipo de contenido (content-type) del servidor.¿Es seguro ejecutar un archivo WASM?
¿Qué programas crean archivos WASM?
wasm32 de Rust con wasm-pack, TinyGo/Go y Clang/LLVM producen una salida .wasm.