Online R Compiler — run R code in your browser
Write R and run it instantly, free, with no signup. It uses real R 4.x · WebAssembly (WebR), so vectors, summary(), data frames and base-R plots all execute in your own browser — your code is never uploaded.
How it works
This compiler runs WebR — the official build of R (the same R 4.x engine you would install from r-project.org) compiled to WebAssembly by the r-wasm project. When you press Run, your code executes inside a sandboxed Web Worker in your browser, not on our server. That makes it private (nothing is uploaded), effortless to scale (your device does the work), and unable to reach our systems or other users.
Because it is the real interpreter, results are identical to desktop R to the last digit. Functions such as mean(), sd(), summary() and lm() follow the definitions in the R language reference. For example, the quartiles in summary()use R's default type-7 sample-quantile rule (Hyndman & Fan, 1996): for a sorted vector of length n and probability p, it interpolates at position h = (n − 1)·p. The worked examples below were reconciled to that rule by hand and reproduced in TypeScript to confirm the engine's output.
Execution is captured through WebR's output API: standard output and standard error stream back to the page in the order R emits them, and top-level expressions auto-print exactly as they would in the R console (so a bare mean(x) prints [1] 6). Base-R graphics are routed to WebR's offscreen canvas device; each plotting call produces an image that is transferred to the Plot pane.
A few deliberate limits keep things safe and fast. The runtime and base R image (about 30 MB) are fetched only on your first Run, so the page itself stays light; after that they are cached. Runs reuse one persistent R global environment, so variables carry over between runs until you press Reset session. Each Run is wrapped in a 25-second timeout and an output cap — if code runs too long, the worker is terminated automatically and your tab stays usable, a guarantee you only get by running in a worker rather than on the main thread. Only packages published as WebAssembly binaries can be installed; native-compiled CRAN packages, local file access and network calls from R are out of scope in this version.
Worked examples
Frequently asked questions
Sources & references
- The R Project for Statistical Computing — the R language and base packages
- WebR (r-wasm) — official WebAssembly build of R and its execution / graphics API
- CRAN WebAssembly package repository — packages installable into WebR at runtime
- R stats::quantile — the default type-7 sample-quantile definition used by summary()
Execution is the unmodified R interpreter via WebR WebAssembly; only the editor and worker glue are custom. The worked-example outputs were last cross-checked against R's published definitions on 2026-06-26.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, an edge case, or want another language added?
Email me at [email protected] — most fixes ship within 24 hours.