Nothing to install in the browser
A web page loads FEAScript from a URL, so simulations run with no setup, licenses or admin rights. In Node.js, FEAScript is one npm package.
FEAScript enables engineering simulations across both browser-based and server-side environments without the overhead of traditional desktop software.
npm install feascript
Why use FEAScript
FEAScript brings the finite element method to the web. You set up the model, solve it and plot the results in JavaScript, in a browser or in Node.js, and you can build the simulation into your own web pages and applications.
A web page loads FEAScript from a URL, so simulations run with no setup, licenses or admin rights. In Node.js, FEAScript is one npm package.
In current web browsers on desktops, tablets and phones, and in Node.js on Windows, macOS and Linux.
The core library is free to use, change and build on under the MIT license, with no license fees.
How to use FEAScript
Call FEAScript from JavaScript in a web page, in a playground such as CodePen or Scribbler, or in Node.js. The example below solves heat conduction in a 2D fin with a hole, live in this page: move a slider and both the code and the result change. Save the code as an HTML file to run it yourself.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Heat Conduction in a 2D Fin with a Hole</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/plotly.js/2.35.3/plotly.min.js"></script>
</head>
<body>
<div id="resultsCanvas"></div>
<script type="module">
import {
FEAScriptModel,
importGmshMesh,
plotInterpolatedSolution,
} from "https://core.feascript.com/dist/feascript.esm.js";
window.addEventListener("DOMContentLoaded", async () => {
// 1. Create the model and select the physics
const model = new FEAScriptModel();
model.setModelConfig("heatConductionScript");
// 2. Load the Gmsh mesh (any hosted .msh file works)
const response = await fetch("https://feascript.com/tutorials/rect_with_hole_quad_quadratic.msh");
const meshFile = new File([await response.text()], "rect_with_hole_quad_quadratic.msh");
const mesh = await importGmshMesh(meshFile);
model.setMeshConfig({ parsedMesh: mesh });
// 3. Apply the boundary conditions (key = Gmsh physical group tag - 1)
model.addBoundaryCondition("0", ["constantTemperature", 200]); // Bottom
model.addBoundaryCondition("1", ["symmetry"]); // Left
model.addBoundaryCondition("2", ["convection", 1, 20]); // Top
model.addBoundaryCondition("3", ["constantTemperature", 200]); // Right
model.addBoundaryCondition("4", ["convection", 1, 20]); // Hole
// 4. Solve
model.setSolverMethod("lusolve");
const result = model.solve();
// 5. Plot the results
plotInterpolatedSolution(model, result, "contour", "resultsCanvas");
});
</script>
</body>
</html>
The simulation runs when this part of the page comes into view.
Features
FEAScript currently solves 1D and 2D problems with linear and quadratic elements.
.msh file
format) with quadrilateral and triangular elements (linear and quadratic)
In development FEAScript is in development, and each release adds features. See what's new for the latest release and the roadmap. To contribute code, read the contribution guidelines.
Verification
FEAScript is checked in three ways: against values published for standard problems, against exact solutions, and against other finite element software on the same meshes. Each result links to the test or run that produced it, so you can check it and run it yourself.
18.26 °C
NAFEMS T4 target: 18.3 °C
The temperature at the target point of NAFEMS T4, a standard heat conduction benchmark with convection, on a 12 × 20 mesh of quadratic elements. The test runs on every change to FEAScript and fails if the value drifts by more than 0.1 °C. Read the NAFEMS T4 test.
Exact
Up to rounding in double precision
Couette flow, a cantilever beam under a tip load and special cases of heat conduction with spatially varying conductivity are set up so that the finite element solution equals the exact solution at the nodes. FEAScript matches it to about 15 significant digits. See the verification tests.
11 digits
Agreement with scikit-fem, node by node
For heat conduction in a 2D fin, on meshes up to 51,681 nodes, FEAScript 0.3.1 matches scikit-fem to 11 significant digits, a largest difference of 1.8e-10 °C. It also matches Elmer to within 5e-6 °C, the rounding of Elmer's output files. See the benchmark results.
NAFEMS T4 is reproduced independently. FEAScript is not affiliated with NAFEMS.
Tutorials
Step-by-step tutorials, each with the full code to run in a web page, on CodePen or in Scribbler. Four to start with, one for each kind of physics:
New to finite elements? Start with Tri's Lab by FEAScript, where you learn the finite element method through games and block-based missions, with no code to write.
Structural mechanics
1D Euler–Bernoulli cantilever beam bending under a concentrated tip load, with the finite element solution verified against the classical analytical solution
Powered by FEAScript
Better Building integrated FEAScript to power their online Heat Transfer Simulator for architects and engineers. Users draw a building detail from material layers, set its boundary conditions, and FEAScript solves the 2D heat conduction in the browser.
FEAScript Studio
FEAScript Studio builds a model from connected blocks, then turns it into a focused application: you choose which inputs users can change and which results they see. The apps run in the browser and can be shared by link or embedded in another website. Any model can be exported as plain FEAScript code.
Resources
The FEAScript documentation covers installation, the physical models and their equations, and the full API reference. Good places to start:
The latest release, 0.3.0 with its fix 0.3.1 (October 2026), added triangular elements, the Euler–Bernoulli beam, the frontal solver for every model, vtk.js plots and VTK export, and the NAFEMS T4 test. Every change is in the changelog.
Next, 0.4.0 brings faster solvers and clearer error messages, and 0.5.0 multi-threading, units and multi-block meshes. Follow the plans in the 0.4.0 roadmap and the 0.5.0 roadmap.
If you find FEAScript useful, please consider supporting its development with a donation. Your support helps fund new features, performance improvements, documentation and tutorials. Companies can sponsor too, with their logo on the home page. See who already supports FEAScript on the sponsors page.
Stay in the loop
Receive project updates and news.