Citation and evidence

TensorFlow.js

22 min full readUpdated 24 references

This article's verification

Report a problem with this article

Edit article
More

Use this article

Raw MarkdownExplore connections

Improve this page

Revision historyDiscuss this article

Topics

Developer ToolsGoogleSoftware Development

Cite this article

TensorFlow.js (often abbreviated TFJS) is an open-source JavaScript library developed by Google for defining, training, and running machine learning models entirely in the web browser, in Node.js, and on mobile through React Native. It was announced on March 30, 2018 at the TensorFlow Developer Summit as the successor to the earlier deeplearn.js library, and it is the JavaScript member of the broader TensorFlow ecosystem, exposing APIs that mirror the Python TensorFlow and Keras interfaces.[1][2] Because computation runs on the user's own device, the official launch post states that "all data stays on the client, making TensorFlow.js useful for low-latency inference, as well as for privacy preserving applications."[1]

TensorFlow logo
TensorFlow logo. Source: Wikimedia Commons, Public domain.

Google describes the library as "an open-source library you can use to define, train, and run machine learning models entirely in the browser, using JavaScript and a high-level layers API."[1] It is distributed under the Apache 2.0 license and published as the npm package @tensorflow/tfjs, with separate packages for individual backends, the model converter, the layers API, and platform adapters. The companion academic paper, presented at MLSys 2019, summarises its purpose: "TensorFlow.js is a library for building and executing machine learning algorithms in JavaScript. TensorFlow.js models run in a web browser and in the Node.js environment."[3]

What is TensorFlow.js used for?

TensorFlow.js is a library for defining tensors, building neural networks, training them with automatic differentiation, and running inference in JavaScript runtimes. Its design goals, set out in the foundational MLSys 2019 paper by Smilkov, Thorat et al., were to bring ML to JavaScript developers with little or no ML experience while letting experienced ML users migrate their work to JavaScript, which required wide functionality and an API spanning several levels of abstraction; as a young library, missing functionality was prioritised over performance.[3] The official documentation frames three core workflows: importing a pre-trained TensorFlow or Keras model for inference, retraining an imported model with transfer learning, and authoring and training new models directly in the browser.[1]

The library targets four main runtimes:

  1. The web browser, where models can run on the user's GPU through WebGL or WebGPU, on the CPU through plain JavaScript, or through compiled WebAssembly (WASM) kernels.
  2. Node.js servers, where bindings to the native TensorFlow C library provide the same speed as Python TensorFlow on CPU and CUDA GPUs.
  3. React Native applications, where an expo-gl adapter exposes the device GPU.
  4. Other JavaScript hosts such as Electron desktops and edge runtimes that ship a browser engine.

In each case the developer writes the same TensorFlow.js code; the library selects the fastest available backend at startup.

"TensorFlow.js: ML for the web and beyond (TF Dev Summit '20)", official video from TensorFlow, published March 18, 2020. Watch on YouTube.

When was TensorFlow.js released?

TensorFlow.js was announced on March 30, 2018, but its lineage starts roughly seven months earlier with deeplearn.js. The table below summarises the major milestones.

DateMilestone
August 11, 2017deeplearn.js, a WebGL-accelerated JavaScript ML library, announced by Google's PAIR team[5]
March 30, 2018TensorFlow.js launched at the TensorFlow Developer Summit; deeplearn.js renamed TensorFlow.js Core[1]
2018Node.js bindings (@tensorflow/tfjs-node, @tensorflow/tfjs-node-gpu) released
February 2020React Native adapter (@tensorflow/tfjs-react-native) released
March 2020WebAssembly (WASM) backend introduced
September 2, 2020WASM backend gains SIMD and multithreading in v2.3.0, up to 10x faster[4]
May 17, 2021MoveNet pose-detection model and new pose API released[6]
May 2, 2023Chrome 113 ships WebGPU by default; TensorFlow.js already supports WebGPU-optimized versions of most operators[7]
September 4, 2024Google rebrands TensorFlow Lite as LiteRT[8]
October 21, 2024Version 4.22.0 of the umbrella @tensorflow/tfjs package released[9]
July 9, 2026Google formally introduces LiteRT.js, its Web AI runtime for .tflite models, describing it as an evolution from TensorFlow.js for that use[24]

Expanded article table

Deeplearn.js (2017)

The direct predecessor of TensorFlow.js was deeplearn.js, a WebGL-accelerated JavaScript library announced by Google researchers Daniel Smilkov and Nikhil Thorat on August 11, 2017.[5] Smilkov and Thorat were members of Google's PAIR (People + AI Research) initiative, which had previously produced the TensorFlow Playground, an interactive in-browser visualisation of small neural networks. Deeplearn.js generalised the techniques used in the Playground into a full library: tensors stored as WebGL textures, fragment shaders implementing element-wise and matrix operations, and an API modelled on TensorFlow and NumPy, with a delayed execution model for training and an immediate (eager-style) execution model for inference, plus full backpropagation.[5]

Deeplearn.js was aimed at visual demos and education. Early projects shipped in deeplearn.js included style transfer, image-to-image translation, and an in-browser implementation of SqueezeNet. Although the library was popular, it lacked official ties to TensorFlow's Python ecosystem, and its API diverged from the Keras conventions familiar to most ML practitioners.

Launch as TensorFlow.js (2018)

On March 30, 2018, Google relaunched deeplearn.js as TensorFlow.js at the TensorFlow Developer Summit.[1] The relaunch added a Keras-compatible Layers API on top of the existing low-level Core API, plus a converter that imports TensorFlow SavedModel and Keras HDF5 files, and renamed deeplearn.js itself to TensorFlow.js Core. The summit talk by Smilkov and Thorat featured a live demo of training a PAC-MAN controller from a webcam feed, showing that the browser could now do real backpropagation, not just inference.[1]

The launch also introduced the Emoji Scavenger Hunt mobile demo, which used the device camera to detect real-world objects matching emoji prompts. Both demos ran entirely in the browser, with no server-side ML. As the launch post put it, "running machine learning programs entirely client-side in the browser unlocks new opportunities, like interactive ML!"[1]

Continued development (2018 to 2024)

After the launch, TensorFlow.js development tracked the broader TensorFlow release cadence and added several major capabilities:

  • Node.js bindings (2018): the @tensorflow/tfjs-node and @tensorflow/tfjs-node-gpu packages exposed native TensorFlow C++ kernels to JavaScript on servers, with optional CUDA acceleration on NVIDIA GPUs.
  • React Native adapter (February 2020): the @tensorflow/tfjs-react-native package brought GPU-accelerated TFJS to mobile apps via Expo's expo-gl and expo-gl-cpp.
  • WebAssembly backend (March 2020): a WASM backend compiled the XNNPACK kernel library to WebAssembly, giving CPU inference a large speedup over plain JavaScript. With SIMD (from version 2.1.0) and multithreading (from version 2.3.0, September 2020), the WASM backend became up to 10x faster than its earlier plain-WASM build.[4]
  • WebGPU by default in Chrome (2023): Google Chrome shipped WebGPU by default in Chrome 113 on May 2, 2023, at which point TensorFlow.js already supported WebGPU-optimized versions of most operators through its WebGPU backend, which uses compute shaders rather than the older fragment-shader trick used by the WebGL backend.[7]
  • WebGPU stabilisation (2024): the WebGPU backend matured through 2024 alongside Chromium's WebGPU API, with continued kernel coverage and benchmark improvements.
  • Version 4.22.0 (October 21, 2024): still the latest stable release of the main @tensorflow/tfjs umbrella package as of November 2026 (a 4.23.0 release candidate was published in January 2025), with TypeScript as the dominant source language for the project.[9]

In parallel, Google's broader on-device ML stack evolved. The team rebranded TensorFlow Lite as LiteRT on September 4, 2024; its FAQ said TensorFlow.js would not change and "will continue to function independently as part of the Tensorflow codebase."[8] On July 9, 2026 Google formally introduced LiteRT.js, a Web AI runtime for LiteRT (.tflite) models that it describes as "a powerful evolution from TensorFlow.js for executing .tflite models" and that can be used inside existing TensorFlow.js pipelines.[24]

Architecture

TensorFlow.js is structured as a small core library plus optional backend modules and higher-level APIs. The pieces fit together in three layers.

Core API

The Core API (@tensorflow/tfjs-core) provides low-level tensor operations, similar to NumPy with automatic differentiation added on top. Tensors are immutable and typed; ops include tf.matMul, tf.conv2d, tf.add, tf.softmax, and several hundred others. Eager execution is the default, meaning each op runs immediately when called. Automatic differentiation is provided through tf.grad and tf.variableGrads, allowing custom training loops and gradient-based optimisation outside the high-level API.

The Core API also exposes memory management primitives. Because WebGL textures live outside the JavaScript garbage collector, developers wrap operations in tf.tidy() to release intermediate tensors automatically, or call dispose() manually on long-lived tensors.

Layers API

The Layers API (@tensorflow/tfjs-layers) is a Keras-compatible high-level API for building, training, and saving neural networks. It supports tf.sequential() for stacked-layer models and tf.model() for arbitrary directed graphs, plus model.compile, model.fit, model.evaluate, and model.predict matching Python Keras conventions. Layers include dense, convolutional, recurrent (LSTM, GRU), normalisation, dropout, and embedding variants. Models written with the Layers API can be saved as a model.json topology file plus binary weight shards, then loaded in any TFJS environment.

Backends

A backend is a TensorFlow.js plugin that implements the actual numeric kernels. The library can be initialised with a specific backend or it will pick the fastest available one. The table below summarises the main backends and where each is used.

BackendRuntimeAccelerationTypical use
WebGLBrowserGPU via WebGL 2.0 fragment shadersDefault browser backend; best for medium and large CNNs
WebGPUBrowserGPU via WebGPU compute shadersNewer browsers; targets best-of-class performance
WASMBrowser, Node.jsCPU via compiled XNNPACK kernels with SIMD and threadsSmall or quantised models; fallback when GPU is unavailable
CPU (Plain JS)Browser, Node.jsPure JavaScriptUniversal fallback; slow but always available
Node.js (CPU)Node.jsNative TensorFlow C++ kernelsServer-side training and inference
Node.js (GPU)Node.jsNative TensorFlow C++ + CUDAServer-side training on NVIDIA GPUs
React NativeMobileGPU via expo-gl (WebGL)iOS and Android apps

Expanded article table

WebGL backend

The WebGL backend is the original GPU path inherited from deeplearn.js. Tensors are stored as WebGL textures and ops are implemented as fragment shaders that read input textures and write output textures. The MLSys 2019 paper reports the WebGL backend as two orders of magnitude faster than the plain JS CPU backend.[3] Shader programs are compiled lazily on first use and cached, so warm-up cost is paid once per shape.

WebGPU backend

The WebGPU backend uses the newer WebGPU API, which exposes compute shaders and explicit GPU memory management instead of repurposing the graphics pipeline. The package @tensorflow/tfjs-backend-webgpu requires a browser with WebGPU enabled. WebGPU shipped in Chrome 113 on May 2, 2023, and the Chrome team reported "more than three times improvements in machine learning model inferences" relative to WebGL for the same workloads.[7]

WASM backend

The WASM backend (@tensorflow/tfjs-backend-wasm) compiles Google's XNNPACK kernel library to WebAssembly. With TensorFlow.js 2.3.0 (September 2, 2020), the WASM backend could use both SIMD vector instructions (supported since 2.1.0) and multithreading; Google engineers reported that SIMD delivers a 1.7x to 4.5x speedup over plain WASM, multithreading adds a further 1.8x to 2.9x, and together they make the backend up to 10x faster than before.[4] The benchmark models cited were BlazeFace (about 0.1 million parameters and roughly 20 million multiply-add operations) and MobileNet V2 (about 3.5 million parameters and roughly 300 million multiply-add operations).[4] WASM is on par with or faster than WebGL for small models such as MediaPipe BlazeFace and FaceMesh because it avoids the fixed overhead of compiling shaders. For medium and large CNNs like MobileNet and BodyPix, WebGL is generally 2x to 4x faster than WASM.

CPU backend

The CPU backend is a pure JavaScript implementation, included as a universal fallback when neither WebGL, WebGPU, nor WASM is available. It is slow but works in any JavaScript host.

Node.js backend

The Node.js backends bind directly to TensorFlow's C++ runtime through Node native add-ons. The CPU package is @tensorflow/tfjs-node; the GPU package is @tensorflow/tfjs-node-gpu and requires a CUDA-capable NVIDIA GPU and the matching CUDA toolkit. On Node, performance is comparable to Python TensorFlow because both frontends drive the same C++ kernels.

Capabilities

Can you train models in the browser with TensorFlow.js?

Yes. TensorFlow.js supports full backpropagation in the browser, which is unusual for a JavaScript ML library and was the headline capability of the March 2018 launch. This enables several patterns that would otherwise require a backend server:

  • Transfer learning on a frozen backbone such as MobileNet, with a small classifier head trained on user-supplied images.
  • Federated learning, where each client trains locally and only sends gradient updates to a server.
  • On-device personalisation of recommendation models, gesture detectors, or text predictors using the user's own data without uploading it.

The Layers API exposes the standard model.fit workflow, and the Core API exposes tf.grad and tf.variableGrads for custom training loops.

Inference

Most real applications load a pretrained model and run inference. TensorFlow.js loads models from a model.json file (containing the topology and weight manifest) plus one or more .bin shards (containing the weights). The tf.loadGraphModel function loads converted TensorFlow SavedModels, and tf.loadLayersModel loads converted Keras models or models saved from the TFJS Layers API.

How do you convert a Python TensorFlow or Keras model to TensorFlow.js?

The tfjs-converter is a Python command-line tool, installed via pip install tensorflowjs, that converts existing models to the TensorFlow.js web format. Supported source formats include:

Source formatTFJS loader
TensorFlow SavedModeltf.loadGraphModel
Keras HDF5 (.h5)tf.loadLayersModel
TensorFlow Hub modulestf.loadGraphModel
PyTorch (indirectly: export to ONNX, convert to a TensorFlow SavedModel, then convert)tf.loadGraphModel

Expanded article table

The converter writes a directory containing model.json and sharded weight files, with shards typically capped at 4 MB each so they cache well in browsers.

What pre-trained models does TensorFlow.js offer?

Google maintains a separate repository, tensorflow/tfjs-models, of pre-trained models published as npm packages under the @tensorflow-models/* scope. The most commonly used models are listed below.

ModelTaskNotes
MoveNetSingle-person pose estimation17 keypoints; 30+ fps on most modern devices; Lightning and Thunder variants[6]
PoseNetMulti-person pose estimationOlder single- and multi-pose model; superseded by MoveNet for single-pose use
BodyPixPerson and body-part segmentation24-part segmentation; used for backgrounds and AR effects
HandPoseHand landmark detection21 keypoints per hand; predicts handedness
Face Landmarks DetectionFace mesh and attentionBuilds on MediaPipe Face Mesh
Face DetectionFace bounding-box detectionLightweight detector for camera streams
MobileNetImage classificationImageNet labels; small enough to fit in a few megabytes
COCO-SSDObject detectionSingle Shot MultiBox Detector trained on COCO
Universal Sentence EncoderText embeddings512-dimensional sentence embeddings for similarity and classification
Speech CommandsKeyword spottingRecognises a small set of voice commands from microphone audio
KNN ClassifierNearest-neighbour classifierUsed as a head for transfer learning on top of MobileNet features
ToxicityToxic comment classificationMulti-label classifier for offensive language

Expanded article table

MoveNet, released on May 17, 2021, is the flagship pose model: it detects 17 body keypoints, ships in a latency-optimised Lightning variant and an accuracy-optimised Thunder variant, and runs faster than real time (30+ fps) on most modern desktops, laptops, and phones.[6]

In addition, Magenta.js (@magenta/music) is a JavaScript port of Google's Magenta research library for music and art generation. It uses TensorFlow.js for GPU-accelerated inference and ships browser-compatible implementations of MusicVAE (variational autoencoder for melodies, drums, and trios), MusicRNN (LSTM-based MelodyRNN, DrumsRNN, ImprovRNN, PerformanceRNN), and GANSynth (GAN-based audio synthesis). Most Magenta.js models can run inside a Web Worker; GANSynth and Onsets and Frames need direct access to the page's AudioContext to synthesise audio.

Common use cases

TensorFlow.js is used for tasks that benefit from running models close to the user. The most common categories are:

  • Interactive in-browser ML demos, such as Google's Teachable Machine, which lets non-programmers train an image, audio, or pose classifier from webcam samples and export it for use in TensorFlow.js, TensorFlow Lite, or full TensorFlow.
  • Client-side image and video processing for video calls and creative tools, including background blur, virtual backgrounds, body-part masks, and AR filters layered on top of camera streams.
  • Edge inference for privacy, where sensitive data such as health images, personal text, or biometric signals never leaves the device. This is closely related to broader edge AI and edge computing trends in machine learning.
  • Educational tools like the TensorFlow Playground and Distill articles, which use small TFJS models to illustrate gradient descent, activation functions, and other ML concepts in the browser.
  • Real-time pose, face, and gesture recognition for AR overlays, fitness apps, and accessibility input. MoveNet suits this because it runs faster than real time (30+ fps) on most modern devices.[6]
  • Web-based games and creative tools, including procedural music generators and webcam-controlled experiences such as the original PAC-MAN demo.
  • Hybrid offline-first apps that run inference locally when the network is unavailable and synchronise results once it returns.

Performance characteristics

The practical performance of TensorFlow.js depends heavily on the chosen backend, the model architecture, and the device. Some rough numbers, drawn from the TensorFlow.js team's own benchmarks and blog posts:

  • WebGL versus CPU: the WebGL backend has been measured at roughly 100x faster than the plain JS CPU backend on typical CNNs. In the official platform guide's benchmark (TensorFlow.js 1.5.2, Chrome on a 2018 MacBook Pro), MobileNet v2 took 37 ms on WebGL versus 923.6 ms on the plain JS backend.[12]
  • WebGL versus WASM: for medium and large CNNs (MobileNet, BodyPix, PoseNet), WebGL is generally 2x to 4x faster than WASM. For very small models such as MediaPipe BlazeFace and FaceMesh, WASM can match or beat WebGL because it avoids shader-compilation overhead.
  • WASM versus plain JS: the WASM launch post measured the (pre-SIMD) WASM backend at 10x to 30x faster than the plain JS backend across its models,[16] and SIMD plus multithreading later made it up to 10x faster again.[4] In a 2020 W3C workshop talk, the team put the WASM speedup over plain JS for MobileNet at 3x to 11x across devices.[23]
  • WebGPU versus WebGL: the Chrome team said at launch that WebGPU brings "more than three times improvements in machine learning model inferences" compared with WebGL.[7]
  • Mobile browsers: performance varies widely by device GPU. iOS Safari historically had stricter WebGL limits than desktop Chrome, which sometimes forces fallback to WASM.
  • Node.js with native bindings: because tfjs-node and tfjs-node-gpu call the same C++ kernels as Python TensorFlow, performance is comparable to native Python TensorFlow on the same hardware.

Memory bandwidth is often the bottleneck for the WebGL backend rather than floating-point throughput, because each op fetches input textures and writes output textures rather than fusing kernels the way a native CUDA implementation would.

How does TensorFlow.js compare with other browser ML libraries?

A number of JavaScript libraries target client-side ML, with different trade-offs in vendor support, model formats, and focus.

LibraryVendorYearBackendsModel formatsFocus
TensorFlow.jsGoogle2018WebGL, WebGPU, WASM, CPU, Node nativeTFJS, SavedModel via converter, Keras .h5General-purpose ML in browser, Node, and React Native
ONNX Runtime WebMicrosoft2021WebGL, WebGPU, WebNN, WASMONNXCross-framework inference; pairs with PyTorch via ONNX export
Transformers.jsHugging Face2023Built on ONNX Runtime Web (WebGPU, WASM)ONNX-converted Hugging Face modelsNLP and vision pipelines mirroring Python transformers
ml5.jsNYU ITP / community2018Built on TensorFlow.jsTFJS-compatible modelsFriendly API for artists and educators
brain.jsCommunity2015CPU, WebGL via gpu.jsInternalSimple feed-forward and recurrent networks
ConvNetJSAndrej Karpathy2014CPU onlyInternalEducational; pre-deeplearn.js era
SynapticCommunity2014CPU onlyInternalArchitecture-free recurrent networks
LiteRT.jsGoogle2025WebGPU, WASM, WebNNLiteRT (.tflite)Browser path for the TensorFlow Lite (LiteRT) ecosystem

Expanded article table

Transformers.js and ONNX Runtime Web have taken much of the LLM and transformer-inference traffic that might otherwise have gone to TensorFlow.js, in part because most large open-weight models are released first as PyTorch checkpoints and exported to ONNX rather than to the TFJS native format. TensorFlow.js remains the more natural choice for projects that already live in the TensorFlow or Keras ecosystem, for in-browser training, and for the rich tfjs-models pretrained library.

Notable applications

  • Teachable Machine (teachablemachine.withgoogle.com): Google's no-code in-browser tool for training image, sound, and pose classifiers. The current version supports three input types (images and videos, sounds, body positions). All training happens locally; the tool exports models for use in TensorFlow.js, TensorFlow Lite, or full TensorFlow.
  • PoseNet and MoveNet demos: Google has released several real-time pose tracking demos using TensorFlow.js, including dance, fitness, and accessibility applications.
  • Magenta.js music tools: browser-based music sketches such as Latent Loops, Beat Blender, and Tone Transfer use Magenta.js and TFJS to run generative music models without a server.
  • AR filters and TikTok-style web filters: many web-based filter pipelines run BodyPix or Face Landmarks Detection through TFJS to compose effects on top of camera streams.
  • In-browser reinforcement learning demos: TensorFlow.js has been used to run small Atari-style RL agents and policy-gradient demos that train in front of the user.
  • Body language and ergonomics analysis tools: posture-tracking webapps use MoveNet and BodyPix to give feedback during exercise or office work without sending video to a server.

What are the limitations of TensorFlow.js?

TensorFlow.js is constrained by the browser sandbox more than by anything intrinsic to its design.

  • Memory limits. Browsers cap the amount of memory a tab can use, often around 2 GB on desktop and much less on mobile. WebGL further caps the maximum texture size, which limits the largest activations a model can hold.
  • Single JavaScript thread. Without Web Workers or the WASM backend's threadpool, all computation runs on the page's main thread, which makes the UI sluggish during heavy training.
  • GPU access is constrained. WebGL and WebGPU expose less of the underlying GPU than native CUDA does. Features such as fused kernels, persistent kernel launches, and tensor cores are not directly accessible.
  • First-load model size. Models in the 10 MB to 50 MB range are practical for fast first-load over the network, with weight shards cached by the browser. Multi-hundred-megabyte models load slowly on first visit.
  • LLM-scale models. TensorFlow.js is not the typical choice for in-browser large language models. Most browser LLM demos use Transformers.js on top of ONNX Runtime Web, with quantised weights and WebGPU compute shaders.
  • Cross-browser quirks. WebGL behaviour varies between Chrome, Firefox, and Safari; WebGPU support is still uneven across mobile browsers, especially on iOS.
  • Native TensorFlow gaps. The kernel coverage of the WebGL and WebGPU backends lags behind TensorFlow's native C++ kernels, so some operations from imported SavedModels fall back to the CPU.

Recent developments (2023 to 2026)

  • WebGPU backend. Chrome 113 shipped WebGPU by default in May 2023, when TensorFlow.js already supported WebGPU-optimized versions of most operators.[7]
  • Transformer support. TensorFlow.js has improved support for transformer architectures, but Hugging Face's Transformers.js has emerged as a popular alternative for browser LLM and transformer inference, often built on ONNX Runtime Web instead of TFJS.
  • LiteRT.js. Google rebranded TensorFlow Lite as LiteRT on September 4, 2024,[8] and on July 9, 2026 formally introduced LiteRT.js, a Web AI runtime for .tflite models that it describes as an evolution from TensorFlow.js for that use, contrasting it with TensorFlow.js's "less performant JavaScript-based kernels."[24]
  • Slower release cadence. As of November 2026, version 4.22.0 (October 2024) remains the latest stable release of @tensorflow/tfjs, with only a 4.23.0 release candidate since (January 2025), and commits to the tensorflow/tfjs repository have been sparse since mid-2025.[9][10]

Integration

TensorFlow.js is framework-agnostic and works with React, Vue, Angular, Svelte, and vanilla JavaScript. Two installation paths are common:

  • NPM: npm install @tensorflow/tfjs adds the umbrella package, which includes the Core API, Layers API, default browser backends (WebGL, CPU), and the Data and Vis utilities. Specific backends can be installed separately, for example @tensorflow/tfjs-backend-webgpu or @tensorflow/tfjs-backend-wasm.
  • CDN: loading <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs"></script> from a CDN gives a window.tf global without a build step, which is convenient for prototyping.

The library is written in TypeScript and ships its own type definitions, so editors can autocomplete tensor shapes and op names. Tree-shaking is supported when importing only the kernels and ops a project uses.

License and governance

TensorFlow.js is released under the Apache 2.0 license, the same license as the rest of the TensorFlow ecosystem. The project is governed by Google with significant external contributions; the source lives at github.com/tensorflow/tfjs. Pre-trained models live in the parallel tensorflow/tfjs-models repository, also under Apache 2.0.

Continue reading

More to read

Topics:Developer ToolsGoogleSoftware Development

References

  1. ^1 ^2 ^3 ^4 ^5 ^6 ^7 ^8TensorFlow Blog. "Introducing TensorFlow.js: Machine Learning in JavaScript." March 30, 2018. blog.tensorflow.org/...machine-learning-javascript
  2. ^TensorFlow.js Official Site. tensorflow.org/js
  3. ^1 ^2 ^3Smilkov, Daniel, Nikhil Thorat, et al. "TensorFlow.js: Machine Learning for the Web and Beyond." Proceedings of MLSys 2019, pp. 309-321. arXiv:1901.05350. arxiv.org/...1901.05350
  4. ^1 ^2 ^3 ^4 ^5Yuan, Ann, and Marat Dukhan. "Supercharging the TensorFlow.js WebAssembly backend with SIMD and multi-threading." TensorFlow Blog, September 2, 2020. blog.tensorflow.org/...ng-tensorflowjs-webassembly
  5. ^1 ^2 ^3Google Research Blog. "Harness the Power of Machine Learning in Your Browser with deeplearn.js." August 11, 2017. research.google/...n-your-browser-with-deeplearnjs
  6. ^1 ^2 ^3 ^4TensorFlow Blog. "Next-Generation Pose Detection with MoveNet and TensorFlow.js." May 17, 2021. blog.tensorflow.org/...th-movenet-and-tensorflowjs
  7. ^1 ^2 ^3 ^4 ^5Beaufort, François, and Corentin Wallez. "Chrome ships WebGPU." Chrome for Developers Blog, April 6, 2023. developer.chrome.com/...webgpu-release
  8. ^1 ^2 ^3Google Developers Blog. "TensorFlow Lite is now LiteRT." September 4, 2024. developers.googleblog.com/...ow-lite-is-now-litert
  9. ^1 ^2 ^3TensorFlow.js Releases. "tfjs v4.22.0." GitHub, October 21, 2024. github.com/...releases
  10. ^TensorFlow.js GitHub Repository. github.com/...tfjs
  11. TensorFlow.js Models GitHub Repository. github.com/...tfjs-models
  12. ^TensorFlow.js Guide: Platform and Environment. tensorflow.org/...platform_environment
  13. TensorFlow.js Guide: Models and Layers. tensorflow.org/...models_and_layers
  14. TensorFlow.js Guide: Node.js. tensorflow.org/...nodejs
  15. TensorFlow.js Guide: Model Conversion. tensorflow.org/...conversion
  16. ^TensorFlow Blog. "Introducing the WebAssembly backend for TensorFlow.js." March 2020. blog.tensorflow.org/...y-backend-for-tensorflow-js
  17. TensorFlow Blog. "TensorFlow.js for React Native is here!" February 2020. blog.tensorflow.org/...js-for-react-native-is-here
  18. Magenta.js Documentation. magenta.github.io/...music
  19. Magenta.js GitHub Repository. github.com/...magenta-js
  20. Teachable Machine. teachablemachine.withgoogle.com
  21. Hugging Face Transformers.js Documentation. huggingface.co/...index
  22. ONNX Runtime Web Documentation. onnxruntime.ai/...web
  23. ^W3C Workshop on Web and Machine Learning: "Fast client-side ML with TensorFlow.js." 2020. w3.org/...fast_client_side_ml_with_tensorflow_js
  24. ^1 ^2 ^3Google Developers Blog. "LiteRT.js, Google's high performance Web AI Inference." July 9, 2026. developers.googleblog.com/...ance-web-ai-inference

Improve this article

Add missing citations, update stale details, or write a clearer explanation. Anyone can edit: changes go live when you publish, and every edit is checked by an editor.

7 revisions · v7 · 4,476 words · full history

Fact-checks are independent of edits: a reviewer re-verifies the article against its sources and stamps the date. How we verify

Research and drafting on this wiki are AI-assisted, under named human editorial standards. How AI is used here

Reviewer note: Independent fact-check of the full article against its cited sources (95 claims, 20 sources fetched); 14 material + 13 minor fixed

Cite this page: AI Wiki. "TensorFlow.js." aiwiki.ai, updated 28 Oct 2026, fact-checked 5 Nov 2026. CC BY 4.0. https://aiwiki.ai/wiki/tensorflow_js

Edit article