| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/API/Document/characterSet | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since July 2015.
The Document.characterSet
read-only property returns the character encoding of the
document that it's currently rendered with.
Note: A "character set" and a "character encoding" are related, but different. Despite the name of this property, it returns the encoding.
A string.
console.log(document.characterSet);
// document's character encoding, such as "ISO-8859-1" or "UTF-8"
| Specification |
|---|
| DOM # ref-for-dom-document-characterset |
This page was last modified on Jun 3, 2025 by MDN contributors.
DocumentactiveElementactiveViewTransitionadoptedStyleSheetsalinkColorallanchorsappletsbgColorbodycharacterSetchildElementCountchildrencompatModecontentTypecookiecurrentScriptcustomElementRegistrydefaultViewdesignModedirdoctypedocumentElementdocumentURIdomainembedsfeaturePolicyfgColorfirstElementChildfontsformsfragmentDirectivefullscreenfullscreenElementfullscreenEnabledheadhiddenimagesimplementationlastElementChildlastModifiedlastStyleSheetSetlinkColorlinkslocationpictureInPictureElementpictureInPictureEnabledpluginspointerLockElementpreferredStyleSheetSetprerenderingreadyStatereferrerrootElementscriptsscrollingElementselectedStyleSheetSetstyleSheetsstyleSheetSetstimelinetitleURLvisibilityStatevlinkColorxmlEncodingxmlVersionadoptNode()append()ariaNotify()browsingTopics()caretPositionFromPoint()caretRangeFromPoint()clear()close()createAttribute()createAttributeNS()createCDATASection()createComment()createDocumentFragment()createElement()createElementNS()createEvent()createExpression()createNodeIterator()createNSResolver()createProcessingInstruction()createRange()createTextNode()createTouch()createTouchList()createTreeWalker()elementFromPoint()elementsFromPoint()enableStyleSheetsForSet()evaluate()execCommand()exitFullscreen()exitPictureInPicture()exitPointerLock()getAnimations()getElementById()getElementsByClassName()getElementsByName()getElementsByTagName()getElementsByTagNameNS()getSelection()hasFocus()hasPrivateToken()hasRedemptionRecord()hasStorageAccess()hasUnpartitionedCookieAccess()importNode()moveBefore()mozSetImageElement()open()prepend()queryCommandEnabled()queryCommandState()queryCommandSupported()querySelector()querySelectorAll()releaseCapture()replaceChildren()requestStorageAccess()requestStorageAccessFor()startViewTransition()write()writeln()AbortControllerAbortSignalAbstractRangeAttrCDATASectionCharacterDataCommentCustomEventDOMErrorDOMExceptionDOMImplementationDOMParserDOMTokenListDocumentFragmentDocumentTypeElementEventEventTargetHTMLCollectionMutationObserverMutationRecordNamedNodeMapNodeNodeIteratorNodeListProcessingInstructionQuotaExceededErrorRangeShadowRootStaticRangeTextTreeWalkerXMLDocumentXPathEvaluatorXPathExpressionXPathResultXSLTProcessorYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |