Latest release GitHub release badge npm version badge Get early access to FEAScript Studio

A JavaScript finite element library, for the web.

FEAScript enables engineering simulations across both browser-based and server-side environments without the overhead of traditional desktop software.

Try it live in your browser
npm install feascript
MIT licensed View on GitHub Prefer no code? Try Tri's Lab or FEAScript Studio

Why use FEAScript

Engineering simulation, without the barriers.

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.

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.

Runs where JavaScript runs

In current web browsers on desktops, tablets and phones, and in Node.js on Windows, macOS and Linux.

Open source

The core library is free to use, change and build on under the MIT license, with no license fees.

How to use FEAScript

Run a simulation with a few lines,
or let your AI assistant do it.

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("heatConduction", { solver: { method: "lusolve" } });

      // 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.setMesh(mesh);

      // 3. Apply the boundary conditions, keyed by the names of the Gmsh physical groups
      model.addBoundaryCondition("bottom", { type: "constantTemperature", temperature: 200 });  // Bottom
      model.addBoundaryCondition("left", { type: "symmetry" });                                 // Left
      model.addBoundaryCondition("top", { type: "convection", h: 1, ambientTemperature: 20 });  // Top
      model.addBoundaryCondition("right", { type: "constantTemperature", temperature: 200 });   // Right
      model.addBoundaryCondition("hole", { type: "convection", h: 1, ambientTemperature: 20 }); // Hole

      // 4. Solve
      const result = model.solve();

      // 5. Plot the results
      plotInterpolatedSolution(model, result, "contour", "resultsCanvas");
    });
  </script>
</body>
</html>
Result, solved in your browser

The simulation runs when this part of the page comes into view.

AI-ready

Or describe it to your AI assistant.

FEAScript needs no installation, so an AI assistant can write a complete simulation that runs in your browser: just describe the problem. Give ChatGPT, Claude, Copilot or any other assistant llms.txt, a one-file summary of the FEAScript API, so the code it writes uses the actual models and options. Save its answer as an HTML file and open it, or run it on CodePen.

docs.feascript.com/llms.txt

Features

What it solves.

FEAScript currently solves 1D and 2D problems with linear and quadratic elements.

Physical modeling

  • Creeping (Stokes) flow
  • Euler–Bernoulli beam bending
  • Front propagation
  • Heat conduction
  • General-form PDE (linear and nonlinear)

Geometry and meshing

  • Built-in mesh generation with named boundaries for lines, rectangles and polygons with holes (quadrilateral or triangular elements; triangulation built on Delaunator and Constrainautor)
  • Unstructured mesh import from Gmsh (.msh file format) with quadrilateral and triangular elements (linear and quadratic)

Numerical methods

  • Linear system solvers:
    • Frontal
    • Jacobi (CPU and WebGPU versions)
    • LU (via math.js)
  • Newton–Raphson method for nonlinear systems

Performance and parallelization

  • Web worker support for multi-threaded computation

Visualization and post-processing

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

Checked against known answers.

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.

Published benchmarks

18.26 °C

NAFEMS T4 target: 18.3 °C

NAFEMS T4, convection temperature at point E
18.26 °C
Code_Aster TPLP302, heated strip largest error at 7 reference points
±1.6e-4 °C
Code_Aster TPLP01, L-shaped domain largest deviation at 12 of 13 reference points
0.24 %

Closed-form solutions

Exact

At the nodes, to about 15 digits

Couette flow
exact
Cantilever beam, tip load
exact
Heat conduction, varying conductivity
exact

Other finite element software

11 digits

Same meshes, node by node, up to 51,681 nodes

scikit-fem, 2D fin largest temperature difference
1.7e-10 °C
Elmer, 2D fin largest temperature difference
1.9e-10 °C
scikit-fem, lid-driven cavity largest velocity difference, relative to the lid speed
4.0e-13

NAFEMS T4 and the Code_Aster cases are reproduced independently. FEAScript is not affiliated with NAFEMS, EDF or the Code_Aster project.

Tutorials

Learn by running.

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:

Creeping flow through a 2D pillar array results

Creeping flow

Creeping flow through a 2D pillar array

Stokes flow in a channel with a staggered array of pillars, on an unstructured Gmsh mesh of quadratic triangles with Taylor-Hood elements

Cantilever beam under a tip load results

Structural mechanics

Cantilever beam under a tip load

1D Euler–Bernoulli cantilever beam bending under a concentrated tip load, with the finite element solution verified against the classical analytical solution

Solidification front propagation results

Front propagation

Solidification front propagation in a 2D domain

Transient simulation of a solidification front advancing through a 2D domain using the eikonal equation

All tutorials

FEAScript in use

Used with FEAScript.

Integration

Heat Transfer Simulator

Better Building's free Heat Transfer Simulator lets architects and engineers draw a building detail and compute U-values and ψ-values in the browser. For complex and curved geometries, higher-order elements, batch runs and custom web applications, its documentation recommends continuing in FEAScript.

Better Building's Heat Transfer Simulator: a wall corner drawn from material layers, with its temperature field and isotherms
Screenshot courtesy of Better Building.

Need a calculator like this for your own product? Work with FEAScript.

FEAScript Studio

Turn models into web applications.

In development

Build an app from a FEAScript model

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.

Cooling fin calculator app built in FEAScript Studio, with sliders for the inputs, the coldest temperature and a temperature plot
Development version. The interface may change.

Resources

Open, documented, and growing.

What's new

The latest release, 0.4.0 (November 2026), added a triangle mesh generator for polygons with holes, much faster direct solvers, errors that stop a wrong solve and list every input mistake at once, loading from a plain script tag, and the Code_Aster benchmark tests. Every change is in the changelog.

Next, 0.5.0 brings multi-threading, multigrid, units with a dimensional check and multi-block meshes. Follow the plans in the 0.5.0 roadmap.

Support

Help FEAScript grow.

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.

GitHub Sponsors Donate on Liberapay

Stay in the loop

Join the mailing list.

Receive project updates and news.