HTML Guides for accept-charset
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
The accept-charset attribute on a <form> element only accepts "UTF-8" as its value. Any other character encoding will trigger a validation error.
Older HTML specifications allowed values like "ISO-8859-1", "Windows-1252", or space-separated lists of encodings. The HTML living standard changed this. Now, "UTF-8" is the sole permitted value. Browsers already default to submitting form data in UTF-8 when no accept-charset is specified, so the attribute is rarely needed at all.
If a form currently specifies a non-UTF-8 encoding, the fix is either to switch the value to "UTF-8" or to remove the attribute entirely. Removing it is usually the better choice, since the browser will use UTF-8 by default when the page itself is served as UTF-8 (which it should be).
HTML examples
Invalid usage
<formaction="/search"accept-charset="ISO-8859-1">
<inputtype="text"name="q">
<buttontype="submit">Search</button>
</form>
Valid usage
Remove the attribute and let the browser default to UTF-8:
<formaction="/search">
<inputtype="text"name="q">
<buttontype="submit">Search</button>
</form>
Or explicitly set it to "UTF-8":
<formaction="/search"accept-charset="UTF-8">
<inputtype="text"name="q">
<buttontype="submit">Search</button>
</form>
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
Pro Trial
Full Pro access. Cancel anytime.
Start Pro Trial →Join teams across 40+ countries