WASM Binary Format Parser

Paste WASM binary as hex or Base64, or upload a .wasm file, and get a real, local, in-browser parse of the module header, section list, import/export tables, and type signatures — instruction streams inside function bodies are not decoded.

FreeOnline Tool
Loading…

How to Use

  1. Choose an input mode: hex string, Base64 string, or "Upload .wasm file" (click to choose or drag a file onto the drop zone).
  2. In hex/Base64 mode, paste your data into the text box. In file mode, the uploaded .wasm file is read by the browser via FileReader into raw bytes and converted automatically.
  3. Click "Parse" (uploading or dropping a file triggers parsing automatically). The page displays, in order: module header info (magic number, version, total size, and validity check), the section list (ID, name, byte size for each section), the import table, the export table, and the type-section function signatures.
  4. Not sure what to paste? Click "Load Sample Data" to load a minimal WASM module hex string that includes a type section and a function section.
  5. Click "Clear" to reset the input and results.
  6. A reference table at the bottom lists all 12 WASM section IDs with their names and meanings for quick lookup.

Features

  • Genuinely parses WASM binary data locally in the browser — hand-written byte-level parsing in JavaScript, including LEB128 variable-length integer decoding — with no third-party WASM toolchain and no file upload to any server.
  • Accepts three input forms: hex string, Base64 string, or a directly uploaded/dropped .wasm file (read via FileReader into an ArrayBuffer).
  • Validates the magic number (00 61 73 6D) and version (01 00 00 00), showing a clear error if either is invalid.
  • Walks the byte stream section by section and lists every section found (ID, name, byte size).
  • Deeply parses three key sections: the Type section (parameter/return type signatures), the Import section (module name, field name, kind: function/table/memory/global), and the Export section (name, kind, index).
  • Other sections it doesn't deeply parse (Code, Data, Element, etc.) still appear in the section list with their ID and byte size — this is a teaching tool and does not decode the full instruction stream.
  • Includes a 12-row quick-reference table of WASM section types.

Use Cases

Quickly see what functions a .wasm file exports
Got a third-party .wasm file and don't know what it exports — drag it in and the Export table immediately lists every export's name, kind, and index, no need to install wasm-objdump or similar CLI tools.
Check whether a WASM file is corrupted or malformed
Suspect a build artifact's .wasm file got truncated or corrupted during transfer or packaging — upload it and see instantly whether the magic number/version check passes to narrow down the problem.
Teach the WASM binary layout hands-on
Explaining WASM's binary structure to a team or students — parse a real file or the sample hex live in front of them to visually show the section breakdown and LEB128 encoding.
Verify a hand-crafted or generated WASM module header
Generated some WASM bytecode with a toolchain and want to sanity-check the format — paste the hex in and confirm the structure matches expectations via the section list and type signatures.

FAQ

Can this tool decode the full WASM instructions (opcodes inside function bodies)?
No. The page states clearly this is a teaching tool — it only parses and shows section-level information (like the actual contents of Type, Import, and Export). It does not decode the instruction stream inside the Code section or similar; it only lists that section's ID and byte size.
Is my uploaded .wasm file sent to a server?
No. The file is read locally via the browser's native FileReader API into an ArrayBuffer, and all parsing happens in your browser with JavaScript — nothing is uploaded anywhere.
Why do I get "invalid hex data"?
Usually because the pasted string contains non-hex characters, or has an odd number of characters (every 2 characters must map to one byte). Check for stray characters or incomplete data.
What happens if sections appear out of order or one is missing?
The parser walks the byte stream from start to end and lists every section it encounters in the order it appears — it does not validate ordering (a well-formed WASM module's sections normally appear in ascending ID order, but the tool won't error out if they don't).