Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The getUint16() method of DataView instances reads 2 bytes starting at the specified byte offset of this DataView and interprets them as a 16-bit unsigned integer. There is no alignment constraint; multi-byte values may be fetched from any offset within bounds.
The offset, in bytes, from the start of the view to read the data from.
littleEndian OptionalIndicates whether the data is stored in little- or big-endian format. If false or undefined, a big-endian value is read.
An integer from 0 to 65535, inclusive.
Thrown if the byteOffset is set such that it would read beyond the end of the view.
| ECMAScript® 2027 Language Specification # sec-dataview.prototype.getuint16 |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 10, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.