---
title: TextEncoder.encoding
slug: Web/API/TextEncoder/encoding
tags:
  - API
  - Encoding
  - Property
  - Read-only
  - Reference
  - TextEncoder
browser-compat: api.TextEncoder.encoding
---
{{APIRef("Encoding API")}}

The **`TextEncoder.encoding`** read-only property returns a
{{DOMxRef("DOMString")}} containing the name of the encoding algorithm used by the
specific encoder.

It can only have the following value `utf-8`.

## Syntax

```js
b = encoder.encoding;
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- The {{DOMxRef("TextEncoder")}} interface it belongs to.
