HTML forms can submit data in two very different formats depending on their enctype. This lesson explains both, and which Express middleware handles each.
The Two Form Content Types
A plain HTML form without a file input defaults to application/x-www-form-urlencoded, a simple key=value&key2=value2 encoding, similar to a query string but sent in the body. Express parses this with express.urlencoded().
A form containing a file input (<input type="file">) must use multipart/form-data, a more complex encoding that splits the body into named parts, each with its own headers, so binary file content can be embedded alongside regular fields.
Multipart bodies are structured as a series of boundary-delimited parts, each with its own Content-Disposition and Content-Type headers, letting a single request carry both plain text fields and binary file data together. This structure is significantly more complex than simple key-value encoding, which is why Express does not parse it out of the box.
Common Mistakes
Adding a file input to a form but forgetting enctype="multipart/form-data", silently breaking the upload.
Trying to parse multipart bodies with express.urlencoded() or express.json(), neither supports it.
Expecting uploaded file data to appear on req.body instead of req.file/req.files.
Not setting { extended: true } on express.urlencoded(), changing how nested field names are parsed.
Key Takeaways
Plain forms use application/x-www-form-urlencoded, parsed by express.urlencoded().
Forms with file inputs must use multipart/form-data, which requires enctype on the form.
Express has no built-in multipart parser, that's what multer is for.
Non-file fields from a multipart form still land on req.body; files land elsewhere.
Pro Tip
If a file upload form silently sends an empty file, check the enctype attribute first, it is the single most common reason multipart uploads fail before ever reaching your Express server.
You now understand the two form data encodings. Next, learn how to handle real file uploads in the File Upload lesson.