1001Ferramentas
🔤Dev

Accept-Charset Header Parser

Breaks an Accept-Charset header into charsets and q-values and ranks them by preference. The header is deprecated; today's clients simply assume UTF-8.

Charsets

Accept-Charset and why nobody sends it any more

Accept-Charset was the header through which a client announced which character encodings it could interpret. It made sense on a web where ISO-8859-1, Windows-1252 and Shift_JIS coexisted and the wrong pick produced an unreadable page. Today it is formally obsolete: RFC 7231 discourages sending it, and browsers have stopped.

The page reads the header and orders the charsets by their q factor, just like the other negotiation headers — an entry without q counts as 1, and the order in the text is not the order of preference. It serves for making sense of old server logs, debugging a client that still sends the header, and working with legacy systems that negotiate by encoding.

The reason for its disuse is simple: UTF-8 won. Practically every current client understands UTF-8, and the recommended route is serving everything in it, declared through the charset parameter of Content-Type. Continuing to negotiate encoding today only adds cache variation and surface for error, with no benefit.

Frequently asked questions

Do browsers still send this header?
No. Chrome and Firefox stopped years ago, precisely because sending it increased user identifiability with no practical benefit. If it shows up in your logs, it came from a programmatic client, an old library or a crawler.
How do I declare the encoding properly?
Through the charset parameter of Content-Type in the response, with the value utf-8. In HTML the charset meta tag also counts, and it must sit within the first 1024 bytes of the document — but when both exist, the HTTP header wins.
Is Accept-Encoding obsolete too?
No, and the two are unrelated: Accept-Encoding deals with compression — gzip, Brotli, zstd — and is heavily used. Accept-Charset dealt with character encoding. The similar names are a frequent source of confusion.

Related Tools