Independent .NET. Built outside Microsoft.

Compile C#
to WebAssembly.

C# with precise GC beats Rust's size-oriented profile for printing 42: 38,919 bytes versus 53,635 bytes. Both are standalone WASI Preview 2 components. NetWasm includes its runtime and reachable precise-GC support.

Live Playground · No account · Your browser does the compiling

C# 15 · 5 development hosts: Linux x64 and ARM64 · macOS ARM64 · Windows x64 and ARM64

hello-netwasm / Release verified

FINAL COMPONENT

38,919

bytes

  • ✓ C# application
  • ✓ Precise garbage collector
  • ✓ Runtime included
  • ✓ Uncompressed

NO CLR.

NO MONO RUNTIME.

NO dotnet.js.

NO APP DLLs.

Measured size

C# beats Rust.
With precise GC included.

The released SDK produces a 38,919-byte Release/Oz component for Console.WriteLine(42), or 13,213 bytes with Brotli quality 11. Rust 1.95.0's documented size-oriented profile produces 53,635 bytes for the same print-42 workload. This is a measured workload, not a claim about the smallest possible Rust binary.

Speed, measured

Faster than Mono AOT.
Same C#, same engine.

NetWasm runs our allocation and garbage-collection benchmarks faster than Mono AOT (.NET 10, wasi-wasm), compiled from the same C# source and run by the same Wasmtime 49.0.3 on an Apple M1 Max. Each figure is the lower median of two 15-run cohorts, and every run is checked against desktop .NET's result. NetWasmGC also takes less time than desktop .NET 11's JIT on all three workloads, and less than desktop NativeAOT on the object graph. Without allocation, NetWasm takes less time than Mono AOT, or matches it, on every workload we publish.

NetWasm 0.9

Call C# from JavaScript.
Like any other module.

A JsModule project publishes C# [JSExport] methods as a typed JavaScript module. A page imports it, calls open(), and calls the exports directly: synchronously on the page, or behind Promises in a Web Worker. C# calls back into JavaScript, including the DOM, through [JSImport].

AOT vs AOT

Native Wasm size.
Measured, not promised.

The NetWasm Release/Oz component for Console.WriteLine(42) is 38.0 KiB. The retained .NET 11 RC1 Blazor WebAssembly AOT print-42 build loads 14.58 MiB of Wasm. These are different deployment stacks, not equivalent UI frameworks.

Uncompressed AOT Wasm: NetWasm is 38.0 KiB, Blazor .NET 10 is 11.71 MiB, and Blazor .NET 11 RC1 is 14.58 MiB.

Uncompressed Wasm, excluding JavaScript and the host engine. Binary units: 1 KiB = 1,024 bytes and 1 MiB = 1,024 KiB. NetWasm selects Compact by default. Reproduce the comparison

An independent .NET again

Mono proved .NET could be bigger than one company.

THE NEXT INDEPENDENT IMPLEMENTATION

starts with Wasm.

Mono is now part of Microsoft. NetWasm brings back an ambitious .NET implementation built independently, in public, by one developer: compiler, CoreLib, runtime, precise GC, SDK, WASI host, browser toolchain, libraries, and test integration. JetBrains gave Kotlin a portable Wasm platform. This is C#’s answer.

The runtime tax is optional

Build with .NET.
Run without .NET.

Roslyn produces CIL. NetWasm compiles the reachable program directly to Wasm, specializes its generics, and links only the runtime support it actually uses. The component is the program.

AOT without the traps

AOT without linker-annotation whack-a-mole.

NetWasm works out what your program needs at compile time. JSON, Regex, dependency injection, and structured logging generate ordinary code the compiler can see, so your app does not break because somebody forgot a “do not trim this constructor” annotation three libraries away.

Try the generated-code examples

VISIBLE TO THE COMPILER

01JSON serializersgenerated code
02Regex enginesgenerated code
03DI activationgenerated code
04Logger messagesgenerated code

✓ Reachability decided at compile time

Smaller by design

Pay for the code you use.
Nothing else gets a free ride.

NetWasm starts with a smaller platform contract: closed-world compilation, precise GC, and explicit host capabilities. It does not drag desktop assumptions into every deployment.

01 / CLOSED WORLD

Unused means gone.

Only reachable code, data, generics, and imports survive. An unused package reference does not become deployment baggage.

02 / C# 15

Modern C#. Native Wasm.

C# 15, generics, exceptions, async, managed memory, and precise garbage collection compile into the final artifact.

03 / WASI

Capabilities are explicit.

Programs receive the clocks, HTTP, files, and host interfaces you choose, not ambient access to the machine.

04 / BOTH ADDRESS WIDTHS

wasm32 today. Memory64 when you need it.

Ship portable wasm32 WASI Preview 2 Components, or target raw wasm32 and wasm64 core modules for advanced hosts.

Not a toy compiler

The C# loop is already here.

Build, run, publish, test, and reuse focused libraries with the commands you already know.

dotnet build·dotnet run·dotnet publish·dotnet test

Free for individuals and small and medium-sized businesses.

NetWasm tooling is free for personal and non-commercial use, education, open-source projects, and small and medium-sized businesses. Open-source work is free when the project's complete source uses an OSI-approved license and the work is not a paid or proprietary deliverable. Any business with fewer than 250 employees across its affiliates and consolidated annual revenue below US$10 million, other than a government entity, may use NetWasm for commercial development and production builds, then sell, host, deploy, and distribute unlimited generated applications and output. Larger organizations pay for internal commercial use by sponsoring a matching tier on GitHub Sponsors, from US$149 a month for five developers up to US$2,499 a month for unlimited developers. OEM use and compilation services require a separate agreement.

Read the Community License →

Local quickstart

Try the real thing.

Install .NET SDK 10.0.303 or newer, create an app, run it locally, and publish a standalone component. Use the .NET 11 SDK when your source uses C# 15.

Five supported development hosts: Linux x64, Linux ARM64, macOS ARM64, Windows x64, and Windows ARM64. NuGet downloads the pinned host tools, including the native nwc compiler, on first restore and reuses them on later builds. No separate Emscripten, Node.js, Python, Git, LLVM, or Binaryen setup is needed.

Read the full quickstart ↗
terminal
$ dotnet new install NetWasm.Templates
$ dotnet new netwasm-app -n HelloNetWasm
$ cd HelloNetWasm
$ dotnet run
42
$ dotnet publish -c Release -o publish/local

Stop reading. Compile something.

Your C#.
One Wasm file.

The Playground is a multi-file C# 15 IDE that runs entirely in your browser. Build and run projects, link validated WebAssembly .a archives through LibraryImport, publish a JSExport Web Worker, inspect artifacts, and export the project to your computer.

NetWasm is ready for early adopters.

NetWasm is pre-1.0, so its API and ABI can evolve. The current profile deliberately excludes runtime reflection, dynamic, runtime assembly loading, managed threading, general managed file APIs, raw sockets, and subprocesses.

See the exact support boundary →