application/json — The Standard JSON MIME Type

Learn when and how to use application/json as the Content-Type for JSON data in APIs, AJAX requests, and configuration files.

Common Types

Detailed Explanation

What is application/json?

application/json is the official IANA media type for JavaScript Object Notation (JSON) data. It was standardized in RFC 4627 (2006) and later updated by RFC 8259 (2017). Whenever a server returns JSON or a client sends a JSON request body, the Content-Type header should be set to application/json.

Common HTTP Usage

Content-Type: application/json; charset=utf-8

The charset=utf-8 parameter is technically optional because RFC 8259 mandates UTF-8 encoding for all JSON, but many servers include it explicitly for clarity.

Why Not text/json?

Although text/json exists informally, it is not an IANA-registered type. Using application/json ensures proper handling by HTTP clients, API gateways, and content negotiation middleware. Browsers and libraries like fetch() and Axios recognize application/json and automatically parse the response body.

Related Types

MIME Type Purpose
application/json Standard JSON
application/ld+json JSON-LD linked data
application/vnd.api+json JSON:API specification
application/problem+json RFC 7807 error responses
application/schema+json JSON Schema documents

Content Negotiation

REST APIs commonly use the Accept header to negotiate format:

Accept: application/json

If the server supports both JSON and XML, setting this header ensures you receive JSON.

Use Case

Use application/json whenever you build or consume REST APIs, store configuration in .json files served over HTTP, or send AJAX requests from a frontend application. It is the de facto standard for web API communication.

Try It — MIME Type Reference

Open full tool