Zero Signup ToolsFree browser tools

Developer Tools

Accept-Language Header Parser

Parse, build, and negotiate HTTP Accept-Language headers in your browser. BCP 47 validator, q-value ranking, and RFC 4647 locale matching.

RFC 9110 / RFC 5646 / RFC 4647

Paste an Accept-Language request header. The leading Accept-Language: prefix is optional.

Samples

5 entries parsed, header prefix stripped

5 valid, 0 errors, 0 warnings. Ordered by q-value, then by original position (RFC 9110).

  1. fr-CH

    language fr; region CH (q=1 (implicit)).

    q=1 *
    Language
    fr
    Region
    CH
  2. fr

    language fr (q=0.9).

    q=0.9
    Language
    fr
  3. en

    language en (q=0.8).

    q=0.8
    Language
    en
  4. de

    language de (q=0.7).

    q=0.7
    Language
    de
  5. *

    Wildcard "*" at q=0.5. Matches any language not already covered above.

    q=0.5

Quick reference

q-value (weight)

A number between 0 and 1 with up to three decimals. Default is 1 when omitted. A value of 0 explicitly rejects the language. Higher q wins; on a tie the earlier entry wins (RFC 9110).

Wildcard *

* matches any language not already listed. Combined with a low q, it lets the server fall back to a default while still expressing your preferences.

BCP 47 shape

language[-script][-region][-variant...]. Examples: en, en-US, zh-Hant-TW, es-419, sr-Cyrl-RS.

RFC 4647 Lookup

Truncate one trailing subtag at a time until a supported locale matches. Singletons (single-letter subtags) are removed together with the next subtag.

How to use

  1. Pick a mode at the top: Parse header to inspect a value, Build header to compose one, or Negotiate match to choose the best supported locale.
  2. In Parse mode, paste the header value (Accept-Language: prefix is optional). Each entry is broken into BCP 47 subtags, the q-value is shown explicit or implicit, and errors or warnings appear inline.
  3. In Build mode, add one row per language tag with an optional q-value. Rows are auto-sorted by q in the output and copy-ready curl, fetch, Express, Nginx, and Next.js snippets appear below the header value.
  4. In Negotiate mode, paste a header on the left and your supported locales (one BCP 47 tag per line) on the right, set a default locale fallback, and read the chosen match with a per-step RFC 4647 Lookup trace.
  5. Use the sample chips and presets to load realistic headers (mixed European, Brazilian Portuguese, Traditional Chinese, malformed for error demos) so you can confirm behavior before pasting your own data.
  6. Click Copy on any entry tag, the full normalized header, or any code snippet to drop the result straight into your code or test fixture.

About this tool

Accept-Language Header Parser is a focused workbench for the HTTP Accept-Language request header defined by RFC 9110 section 12.5.4 (formerly RFC 7231 section 5.3.5). The header is a comma-separated list of language ranges, each optionally weighted by a q-value between 0 and 1 (with up to three decimals, per spec), that tells a server which natural languages the client would like the response in. Browsers send it on every request, mobile clients copy it into their REST calls, and edge platforms read it to choose the right translation. The tool has three modes that cover the full negotiation workflow. Parse mode accepts any header value (with or without the literal Accept-Language: prefix), splits it on commas while preserving the per-entry q-value, and emits one card per entry with the original token, the canonical case form (lowercase language, Title-case Script, UPPER REGION per BCP 47 / RFC 5646), every subtag broken out (language, extended language, script, region, variants, extensions, private-use), and the explicit or implicit q-value. The validator covers the BCP 47 grammar in full: 2-3 letter ISO 639-1/2 language subtags, the up-to-three extlangs that follow zh and ar, 4-letter script subtags, 2-letter or 3-digit region subtags, 5-8 alphanumeric variant subtags, single-letter extension singletons with their values, the x- private-use prefix, and the grandfathered Appendix A list (i-klingon, sgn-BE-FR, no-bok, art-lojban, and friends). Errors and warnings are reported per entry: malformed q-values, q outside [0, 1], more than three q decimals, leading/trailing/double hyphens, characters outside the BCP 47 character set, duplicate entries with the position of the earlier copy, whitespace inside a tag, script without region, and unusual extended language usage. The Build mode renders a small editable list of language-tag rows, each with its own q-value; the resulting header value is composed in q-descending order and shown alongside copy-ready snippets for curl, JavaScript fetch, Express (req.acceptsLanguages), Nginx (proxy_set_header), and Next.js next.config.js headers. The Match (Negotiate) mode pairs the header with a list of locales your server supports plus a configurable default. It runs RFC 4647 Lookup against the q-ranked ranges, including the standard truncation fallback (en-US falls back to en, zh-Hant-TW falls back to zh-Hant then zh) and the singleton-strip rule, and reports the chosen locale, the reasoning, and the per-range attempts so you can see exactly why a particular translation was selected. Useful for backend engineers debugging i18n routing, edge devs writing accept-language middleware on Cloudflare Workers or Vercel Edge, mobile devs building a clean Accept-Language header for their HTTP client, QA testing locale fallbacks without a real browser, and writers of content delivery infrastructure who need to verify that en-GB falls back to en when only the latter is translated. Everything runs locally in your browser; the headers, supported locales, and matched results never leave your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools