{ Content-Type Negotiator }

// test accept header priority against content-type options

Match Accept header values against available Content-Type options. Inspect priority, q-values, and negotiation outcome — free, browser-based.

Comma-separated MIME types with optional q-values
One MIME type per line — what your server can serve
PRESETS:
⚖️

Ready to negotiate

Enter an Accept header and available types, then click Negotiate

HOW TO USE

  1. 01
    Paste Accept Header

    Enter the raw Accept: value from an HTTP request, including any q-values.

  2. 02
    List Available Types

    Add the Content-Types your server can actually respond with, one per line.

  3. 03
    View Negotiation

    See the best match, full priority ranking, and which rule (exact / wildcard / */*) triggered each match.

FEATURES

q-value parsing Wildcard support Specificity ranking Preset examples JSON export

USE CASES

  • 🔧 Debug REST API content negotiation
  • 🔧 Understand browser Accept header priorities
  • 🔧 Test server response format selection
  • 🔧 Learn RFC 7231 media type precedence rules

WHAT IS THIS?

HTTP content negotiation is how a client and server agree on the format of a response. The client sends an Accept header listing acceptable MIME types with optional priority weights (q-values). The server picks the best available match.

RELATED TOOLS

FREQUENTLY ASKED QUESTIONS

What is a q-value in an Accept header?

A q-value (quality factor) is a decimal between 0 and 1 that indicates preference. q=1.0 is the highest (default if omitted). q=0 means "not acceptable." For example, text/html;q=0.9 is slightly preferred over */*;q=0.8.

How does wildcard matching work?

The Accept header supports two wildcards: type/* (e.g., text/* matches any text subtype) and */* (matches any media type). Exact matches always win over wildcard matches, even if the wildcard has a higher q-value at the same level.

What does "specificity" mean here?

Specificity determines the winner when two rules have equal q-values. An exact match (text/html) has specificity 2, a type wildcard (text/*) has specificity 1, and the global wildcard (*/*) has specificity 0. Higher specificity wins ties.

Why does the browser send such a complex Accept header?

Browsers list many MIME types to handle diverse server configurations. Modern browsers typically prefer text/html first, followed by XML variants, then images, then anything via */* at lower q-values — reflecting their rendering capabilities.

What happens if no type matches?

If no available Content-Type satisfies the Accept header (all have q=0 or no match exists), the negotiation fails. In HTTP, the server should respond with 406 Not Acceptable. This tool shows all available types as "Rejected" in that case.

Is this tool 100% RFC-compliant?

This tool implements the core rules from RFC 7231 Section 5.3.2 — q-value parsing, exact vs wildcard precedence, and specificity-based tiebreaking. It covers the vast majority of real-world cases. Edge cases like parameter matching (e.g., charset=utf-8) are not yet included.

What is HTTP Content-Type Negotiation?

HTTP content negotiation is the mechanism defined in RFC 7231 that allows a client and server to agree on the most suitable representation of a resource. When a browser or API client makes a request, it sends an Accept header listing the media types (MIME types) it can handle, ranked by preference. The server inspects this list, compares it against the formats it can actually serve, and picks the best available match.

This process is fundamental to building flexible, interoperable web APIs. A single endpoint at /api/data might serve application/json for JavaScript clients, application/xml for legacy enterprise systems, and text/csv for data exports — all based purely on what the client requests in its Accept header.

💡 Looking for premium web development assets? MonsterONE offers unlimited downloads of templates, UI kits, and assets — worth checking out.

Understanding Q-Values and Priority

Each MIME type in an Accept header can carry an optional quality factor (q), a decimal from 0.001 to 1.000. When absent, q defaults to 1.0, meaning "fully preferred." A value of 0 means "not acceptable at all." This lets clients express nuanced preferences:

Servers process these priorities in descending order, selecting the first available type that the client accepts. If multiple types share the same q-value, specificity rules break the tie.

Specificity: How Wildcards Are Ranked

The Accept header supports two wildcard forms. A type wildcard (text/*) matches any subtype under a given media type family. The global wildcard (*/*) matches anything. Specificity defines precedence when q-values are equal:

This means text/html;q=0.9 wins over text/*;q=0.9 which wins over */*;q=0.9, even though all three have identical q-values. The RFC mandates this to prevent overly broad rules from outcompeting precise declarations.

Common Accept Header Patterns

Web browsers typically send verbose Accept headers like text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8. This reflects the browser's full rendering capability hierarchy. Chrome and Firefox have slightly different orderings that can affect server behavior.

REST API clients often send Accept: application/json with nothing else, signaling they only want JSON. A well-behaved server should return 406 Not Acceptable if it can only serve XML.

cURL by default sends Accept: */* — it will take anything. This is why testing APIs with curl can mask content negotiation bugs that real clients would trigger.

Why This Tool Is Useful for Developers

Debugging content negotiation failures is notoriously tricky because the logic happens invisibly inside the HTTP stack. Frameworks like ASP.NET Core, Laravel, and Django all implement negotiation differently, with subtle variations in how they handle wildcards, parameter matching, and fallbacks. Common bugs include:

This tool lets you paste a real Accept header from browser DevTools or server logs, list what your endpoint can actually serve, and instantly see which type wins and why. The JSON export makes it easy to document negotiation behavior in API specs or test fixtures.

RFC 7231 and the HTTP Standard

HTTP content negotiation is standardized in RFC 7231 (HTTP/1.1 Semantics), Section 5.3. The same rules apply in HTTP/2 and HTTP/3 since negotiation is a semantic-layer feature. Key points from the spec: media ranges are matched using a "most specific match" algorithm; parameters other than q are treated as media-type parameters and affect matching; and servers are not required to implement negotiation — they may ignore the Accept header and respond with any type, though well-designed APIs should always honor client preferences.