How to use it 01 Pick a kernel JavaScript and MATLAB / Octave run locally; Python (Pyodide) and R (webR) need a runtime download.02 Type at the prompt and press Enter. Shift+Enter adds a newline, ↑/↓ walk history, Ctrl/Cmd+L clears. An unfinished statement — open bracket, MATLAB ... line, Python line ending in : — turns the prompt into … and Enter continues it. 03 Switch to Cells for the notebook. Each cell has its own kernel selector, so JavaScript and Python cells can sit in one document; Ctrl+Enter runs one cell, Run above runs it and the cells before, Run all walks the list. 04 Move data in the Vars pane. Pull all copies session variables into the data workspace; Push all injects them into the session — the only bridge between languages. 05 Check the Figures pane. MATLAB and JavaScript plot output downloads as SVG or PNG; matplotlib figures arrive as PNG images.
Worked example Solve a system in the MATLAB kernel, then verify it in JavaScript over the shared workspace. Every readout below reproduces from the same input.
Press Pull all in the Vars pane: the workspace gains A (3×3 matrix ) and b, x (3-vectors with previews 8 -11 -3 and 2 3 -1). Switch to JavaScript, press Push all , and the same values are in the session:
The residual is not zero — the solve is double precision, so 8.8817841970013e-16 is as close as floating point gets.
#1 >> A = [2 1 -1; -3 -1 2; -2 1 2]; b = [8; -11; -3];
>> x = A\b
x =
2.0000
3.0000
-1.0000
>> norm(A*x - b)
ans = 8.8818e-16#2 > math.multiply(A, x)
[8, -11, -3]
> math.norm(math.subtract(math.multiply(A, x), b))
8.8817841970013e-16
What each kernel is
JavaScript runs on mathjs with project libraries injected (math, cas, stats, fin, logic, graph, latex, currency, date, family, print, ws, plot); no download; the session is rebuilt from the source (see the pitfall).
MATLAB / Octave is a TypeScript interpreter for the common subset: column-major doubles, cells, strings, control flow and about 120 built-ins, with no structs, classes, complex numbers, sparse or integer types. It runs locally under a 4 × 10⁷-operation or 8-second budget.
Python (Pyodide 0.28.3) downloads about 12 MB on first use; imports trigger the package loader, matplotlib figures return as captured PNGs, and pulled numpy arrays and pandas DataFrames become matrix/vector and table variables.
R (webR 0.6.0) downloads about 30 MB, keeps webR's base R global environment between runs, and returns no plots — use text in R or matplotlib in Python.
Limits to keep in mind
No interrupt. Code runs synchronously on the main thread — no Ctrl+C or stop button; chunk long work, and only MATLAB has an internal budget.
Sessions end with the page. Transcript, history and notebook text survive a reload; session variables do not. Only workspace variables persist (each up to 20,000 elements) — the Vars pane is the save button.
First use needs the network. Python and R are fetched from cdn.jsdelivr.net; a failed download offers a retry, and a successful one is cached. What it does not do. It is not MathWorks MATLAB or a package manager: no toolboxes, Simulink, structs, complex or sparse types; Python is limited to Pyodide's package set; R returns no graphics. Bring data through the data workspace ; for code-free matrix work use Math Tools , for summaries and tests Statistics , for one typed expression the scientific calculator .
The JavaScript session is scanned, not interpreted Only top-level let/const/var declarations and plain name = … assignments are captured. Two consequences catch almost everyone:
A variable first created inside a block or function body never enters the session. After if (true) { let hidden = 41; }, typeof hidden reads undefined — no error line warns you.
A run that throws writes nothing back, so variables computed before the error are lost. Run let before = 1; throw new Error('boom'), read the boom error, then typeof before reads undefined ; a top-level let kept = 41 still answers kept + 1 with 42 .
Python, R and MATLAB keep sessions natively, so this is specific to JavaScript.
Where it fits Cross-checking a calculation in a second language Solve in MATLAB and recompute the residual in JavaScript over the shared workspace, as above: two implementations agree to 8.8817841970013e-16. Export the notebook as JSON to keep the code (results are dropped and re-running reproduces them), or export one language's cells as a native script (notebook.js, notebook.m, notebook.py, notebook.R).
Moving data between languages Clean a table in Python, then Pull all into the workspace and Push all into R or MATLAB for the next step — or keep the variables across pages in the data workspace . A pulled vector goes straight into Statistics for summaries and tests.
Privacy Your code, console transcript and variables stay in your browser; only the Python and R runtimes are fetched from cdn.jsdelivr.net, once.
References
Pyodide, Pyodide documentation , pyodide.org (访问日期:2026-10-01)— Python and scientific packages in WebAssembly.
webR, webR documentation , docs.r-wasm.org (访问日期:2026-10-01)— R in the browser: console and session semantics.
MathWorks, mldivide, \ , mathworks.com (访问日期:2026-10-01)— the backslash operator solves square linear systems.
MDN Web Docs, let , developer.mozilla.org (访问日期:2026-10-01)— block scope behind the session trap.
mathjs, Documentation , mathjs.org (访问日期:2026-10-01)— the library injected into JavaScript runs.
R Core Team, An Introduction to R , cran.r-project.org (访问日期:2026-10-01)— base R objects and sessions.
Calculators in this hub
Hand-picked tools, one click away. The mini versions compute live and carry your values into the full calculator.
Sources & review
Reviewed by CalcX Editorial Team
Updated 2026-10-01