Content-Type Header Builder
Build Content-Type headers with the correct MIME type, charset, and boundary parameters. Copy as header or curl flag.
About This Tool
The Content-Type Header Builder is a free browser-based tool
that helps developers construct syntactically correct
Content-Type HTTP header values. The Content-Type header
tells the server or client what media type the body of the request
or response contains. Getting it wrong can cause parsing failures,
character encoding issues, or rejected API requests. This tool
removes the guesswork by letting you pick from a curated list of
MIME types organized by category, add the appropriate charset and
boundary parameters, and copy the result in multiple output
formats.
The builder supports every common media type you are likely to
encounter in web development: application/json for REST APIs,
application/x-www-form-urlencoded for classic form submissions,
multipart/form-data for file uploads, XML and SOAP variants,
plain text, HTML, and binary types like application/octet-stream
or application/pdf. You can also enter a fully custom MIME type
for vendor-specific or experimental media types. For multipart
types the tool auto-generates a random boundary string that you
can customize or regenerate with a single click.
Once you have configured your Content-Type value, choose from four
output formats: a raw HTTP header line, a curl -H flag ready to
paste into your terminal, a JavaScript fetch() headers snippet,
or an axios configuration object. Quick presets for common
scenarios like JSON API, Form POST, File Upload, GraphQL, and XML
SOAP let you jump straight to the right value without any manual
selection.
If you need to inspect the headers your server is returning, try the HTTP Header Analyzer. To convert a full curl command into code, check out the cURL to Code converter. For a reference of HTTP response status codes, see the HTTP Status Codes lookup.
All processing runs entirely in your browser. No data is transmitted to any server. Your header values and API details remain private.
How to Use
- Choose a Category from the dropdown (JSON, Form Data, Multipart, XML, HTML, Plain Text, Binary, or Custom).
- Select the specific MIME Type from the filtered list, or type your own when using the Custom category.
- Optionally set a Charset parameter (e.g.
utf-8,iso-8859-1) to specify character encoding. - For multipart types, review the auto-generated Boundary string or click the refresh icon to generate a new one.
- Add any Additional Parameters as
key=valuepairs, separated by semicolons or newlines. - Pick an Output Format: Header value, curl -H, fetch(), or axios.
- Click Copy or press Ctrl+Shift+C to copy the result to your clipboard. Use the Quick Presets for common scenarios.
Popular Content-Type Header Examples
FAQ
What is the Content-Type header?
The Content-Type header is an HTTP header that indicates the media type (MIME type) of the resource or the data being sent in the request body. It tells the recipient how to parse the body. For example, application/json means the body is JSON, while multipart/form-data indicates a file upload with boundary-delimited parts.
When should I include a charset parameter?
Include a charset parameter whenever you send text-based content and need to specify the character encoding explicitly. For JSON, RFC 8259 specifies that JSON text exchanged between systems must be encoded in UTF-8, so charset=utf-8 is common but technically optional. For HTML and XML, specifying charset prevents the browser from guessing the encoding incorrectly.
What is the boundary parameter in multipart types?
The boundary is a unique string that separates each part in a multipart message body. It must not appear in any of the part contents. When you use multipart/form-data for file uploads, the boundary is required so the server knows where each part begins and ends. This tool auto-generates a random boundary string that is highly unlikely to collide with your content.
What is the difference between application/json and application/vnd.api+json?
application/json is the standard MIME type for any JSON payload. application/vnd.api+json is the media type specified by the JSON:API specification (jsonapi.org). Using the JSON:API media type signals that the request or response follows the JSON:API structure with specific resource, relationship, and error formats.
Should I use text/xml or application/xml?
RFC 7303 recommends application/xml for most cases because it defaults to UTF-8 encoding. text/xml defaults to US-ASCII when no charset is specified, which can cause encoding issues. Use application/xml for API payloads and application/soap+xml for SOAP 1.2 services. text/xml is acceptable when the XML is primarily human-readable.
Is my data safe?
Yes. All processing happens entirely in your browser using JavaScript. No header values, MIME types, or any other data is sent to any server. You can verify this by checking the Network tab in your browser's developer tools while using the tool.
Can I use a custom or vendor-specific MIME type?
Yes. Select the Custom category and type any MIME type you need, including vendor-specific types (e.g. application/vnd.mycompany.myapp.v2+json) or experimental types (e.g. application/x-ndjson for newline-delimited JSON). The tool will include it in the Content-Type header along with any charset or additional parameters you configure.
Related Tools
HTTP Header Analyzer
Fetch and analyze HTTP response headers for any URL. Check security headers, caching, CORS, and more.
Curl to Code Converter
Convert curl commands to Python, JavaScript fetch, PHP, Go, and more programming languages.
HTTP Status Codes
Browse, search, and learn about all HTTP status codes with detailed explanations.
CSP Header Generator
Build Content Security Policy headers visually with directive presets and real-time policy output.
Nginx Config Generator
Generate Nginx server blocks visually. Configure reverse proxy, SSL, static files, and redirects with a GUI.
HTTP Method Reference
Interactive HTTP method reference with detailed specs for GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, and more.
MIME Type Reference
Browse and search common MIME types for web development. Covers JSON, images, video, fonts, and more.
HTTP/2 vs HTTP/3 Comparison
Side-by-side comparison of HTTP/1.1, HTTP/2, and HTTP/3 protocols with feature details, performance characteristics, and migration guides.