This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
Note: This feature is available in Web Workers.
The TextEncoder.encoding read-only property returns a string containing the name of the encoding algorithm used by the specific encoder.
It always has the value utf-8.
A string with the value utf-8.
| Specification |
|---|
| Encoding> # dom-textencoder-encoding> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
encoding |
38 | 79 | 18 | 25 | 10.1 | 38 | 18 | 25 | 10.3 | 3.0 | 38 | 10.3 |
TextEncoder interface it belongs to.
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/encoding