Read both names.characterSet is the standard property name.
Alias check.charset is kept for older scripts and equals the same string.
Strict equality.=== is true when both report the same label.
Style tip. Write characterSet in new tutorials and production code.
Compatibility
Browser Support
Document.characterSet is Baseline Widely available on MDN (since July 2015). It works across modern browsers and long-supported evergreen releases.
✓ Baseline · Widely available
Document.characterSet
Read-only encoding label string for the current document — typically UTF-8 on modern pages.
99%Browser support
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
characterSetExcellent
Bottom line: Safe everywhere you teach DOM APIs. Prefer characterSet over the legacy charset alias. Pair with a correct <meta charset="utf-8"> in every HTML page.
Frequently Asked Questions
A read-only string naming the character encoding the document is currently rendered with — for example UTF-8 or ISO-8859-1.
No. MDN marks Document.characterSet as Baseline Widely available (since July 2015). It is a standard read-only DOM property.
MDN notes that a character set and a character encoding are related but different. Despite the property name, characterSet returns the encoding label the browser uses to interpret bytes.
Yes. document.charset is a legacy alias that returns the same value as document.characterSet. Prefer characterSet in new code.
Typically <meta charset="utf-8">, the Content-Type HTTP charset parameter, or a BOM. The browser picks the effective encoding from these signals.
No. It is read-only. Fix encoding with the HTML meta tag, server headers, or by saving the file correctly — not via JavaScript assignment.