Interpreter engine
The core package is written in TypeScript and simulates a subset of MATLAB®/Octave syntax.
TypeScript numerical computing for the browser
MathJSLab simulates a subset of the MATLAB®/Octave language. Use one of the online applications to explore MathJSLab features. Use the package mathjslab in your project to run expressions, functions and matrices, with MathML-rendered results and full compatibility in the web browser.
npm install mathjslab
>> A = [1 2; 3 4]>> det(A)>> f = @(x) a*x^2+b*x+cExecution flow
MathJSLab reads the input, parses it into an internal representation, evaluates expressions and commands, and renders mathematical results as MathML for the browser.
Features
The core package is written in TypeScript and simulates a subset of MATLAB®/Octave syntax.
The web app is a mathjslab interpreter demonstration Progressive Web App (PWA) with Web Components, responsive layout, Markdown help, schemes and diagrams with Mermaid and charts with Plotly.
Command help is organized in English, Portuguese and Spanish.
The interpreter works with arbitrary precision arithmetic through decimal.js and can generate expressions and results rendered in MathML.
Expressions, matrices, complex numbers, control flow, anonymous and user-defined functions, closures and classes expand the programming possibilities.
Sessions retain variables and functions between commands. Asynchronous execution supports suspending and resuming calculations; applications integrate Workers and interpreter plot outputs.
Markdown engine
The companion package mathjslab-markdown brings the project’s Markdown engine into a reusable library. It displays documents in the browser and integrates the mathjslab interpreter when the host application enables executable examples.
Markdown rendering, document navigation and the optional <markdown-document> Web Component help other applications present documentation and learning materials.
Mathematical formulas, Mermaid diagrams and educational visualizations use optional renderers loaded on demand.
Executable examples use the mathjslab package, with executors and Workers supplied by the host application. The Markdown engine can also be used independently.
npm install mathjslab-markdown
Ecosystem
The mathjslab interpreter is the project’s core. The companion mathjslab-markdown package presents educational documents, and the web applications integrate these capabilities. The GitHub organization also maintains the project website and shared resources.
TypeScript engine published to npm, with parser, evaluator and mathematical rendering components.
Reusable Markdown engine, educational extensions and browser document component.
Progressive web app that exposes the interpreter in a responsive browser interface.
Scientific calculator prompt application hosted at calc.mathjslab.com and powered by the MathJSLab package.
Shared profile, repository templates and project-wide support material for MathJSLab.
Multilingual website presenting the interpreter, Markdown engine and ecosystem applications.
Publication
The MathJSLab interpreter and its ecosystem are distributed as free software, with reusable packages and publication identifiers.
The mathjslab interpreter and the mathjslab-markdown engine are published separately on npm under the MIT license. The DOI and ISBN records shown below belong to their respective projects.
The TypeScript interpreter package is distributed through npm, mirrored through jsDelivr and licensed under MIT.
Reusable Markdown engine, educational extensions and browser document component.
The browser application demonstrates the interpreter, is maintained on GitHub and has its own DOI and ISBN records.
The calculator application offers a simplified prompt interface hosted at calc.mathjslab.com, with its own DOI and project publication badges.
Resources
Try the application and calculator, install the mathjslab interpreter or the mathjslab-markdown engine, and explore the source code and command help.
MathJSLab is intended for educational purposes, helping teachers and students use a computer-aided calculation tool that runs in the browser.
MathJSLab is not affiliated, sponsored or endorsed by The MathWorks, Inc. MATLAB® is a registered trademark of The MathWorks, Inc.
Contact
To contact the MathJSLab project organization, write to the address
License
MathJSLab is distributed as free software under the MIT License, allowing use, modification and redistribution under the terms below.
MIT License
Copyright (c) 2016-2026 Sergio Lindau, mathjslab.com, ISBN 978-65-00-82338-7
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.