• Skip to main content
  • Skip to search
  • Skip to select language
MDN Logo
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web technology for developers
  2. Web APIs
  3. TextEncoder
  4. TextEncoder.encoding
  • Change language

Table of contents

  • Syntax
  • Specifications
  • Browser compatibility
  • See also

TextEncoder.encoding

The TextEncoder.encoding read-only property returns a DOMString containing the name of the encoding algorithm used by the specific encoder.

It can only have the following value utf-8.

Syntax

b = encoder.encoding;

Specifications

Specification
Encoding
# dom-textencoder-encoding

Browser compatibility

See also

  • The TextEncoder interface it belongs to.

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Sep 14, 2021, by MDN contributors

Change your language

Related Topics

  1. Encoding API
  2. TextEncoder
  3. Constructor
    1. TextEncoder()
  4. Properties
    1. encoding
  5. Methods
    1. encode()
    2. encodeInto()
  6. Related pages for Encoding API
    1. TextDecoder
    2. TextDecoderStream
    3. TextEncoderStream
MDN Logo
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

  • MDN on Twitter
  • MDN on Github

Mozilla

  • Mozilla on Twitter
  • Mozilla on Instagram

© 2005-2025 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies