What Is This?
The application/x-www-form-urlencoded MIME type is the default encoding for HTML form submissions. It encodes form data as key-value pairs where keys and values are URL-encoded (spaces become +, special characters become %XX). This encoding is efficient for simple text data but inefficient for binary files.
Common Uses
Common Use
Standard HTML form submissions without file uploads
Common Use
OAuth 2.0 token endpoint requests
Common Use
Simple API POST requests with key-value data
Common Use
Legacy web application forms
Examples
Serve files with the application/x-www-form-urlencoded MIME type:
# Nginx
location ~ \.$ {
add_header Content-Type "application/x-www-form-urlencoded";
}
# Apache
AddType application/x-www-form-urlencoded Use this MIME type in HTML or HTTP:
Content-Type: application/x-www-form-urlencoded <!-- HTML reference --> <link rel="preload" href="file" as="fetch" crossorigin>
Related Entries
More from this reference:
application/json
The standard MIME type for JavaScript Object Notation (JSON) data interchange.
application/pdf
The MIME type for PDF (Portable Document Format) documents.
application/zip
The MIME type for ZIP archive files used for compression and bundling.
application/xml
The MIME type for XML documents and data interchange.
application/octet-stream
The generic MIME type for arbitrary binary data, often used for unknown file types or forced downloads.
Frequently Asked Questions
Why is this encoding inefficient for binary data?
Binary data must be base64-encoded when sent as application/x-www-form-urlencoded, which increases the size by 33%. For file uploads, use multipart/form-data instead, which sends binary data more efficiently.
What is the size limit for URL-encoded data?
Most servers have a configurable limit (typically 1-8 MB) for URL-encoded request bodies. The URL length itself is limited to about 8 KB in most browsers and servers.