coderef

Float16ArrayBaseline · Newly available

Float16Array is a typed array of 16-bit floating point numbers.

Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Apr 4, 2025.

Browser support

DesktopChrome
1–134Not supported
135+Supportedsince Apr 1, 2025
Current: 155
Edge
12–134Not supported
135+Supportedsince Apr 4, 2025
Current: 154
Firefox
1–128Not supported
129+Supportedsince Aug 6, 2024
Current: 157
Safari
1–18.1Not supported
18.2+Supportedsince Dec 11, 2024
Current: 27
MobileChrome Android
18–134Not supported
135+Supportedsince Apr 1, 2025
Current: 155
Firefox Android
4–128Not supported
129+Supportedsince Aug 6, 2024
Current: 157
Safari iOS
1–18.1Not supported
18.2+Supportedsince Dec 11, 2024
Current: 27

How to use

Every current browser supports this, but it only became Baseline on Apr 4, 2025. Use it as a progressive enhancement, or keep a fallback if you support older devices.

Example

Full syntax and examples are on MDN: getFloat16.

Feature detection

JS · check before using
if (typeof Float16Array !== "undefined") {
  // Float16Array is available
}

Sub-features

Support for each part of the feature (5). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
DataView.getFloat1613513512918.213512918.2
DataView.setFloat1613513512918.213512918.2
Float16Array13513512918.213512918.2
Float16Array.Float16Array13513512918.213512918.2
Math.f16round13513512918.213512918.2