HTML <form> enctype Attribute

❮ HTML <form> tag


<form action="action.php" enctype="application/x-www-form-urlencoded">


The enctype attribute specifies how form data should be encoded before being sent to the server.

The default is application/x-www-form-urlencoded. This encoding replaces blank characters in the data with a plus character (+) and all other nonprinting characters with a percent sign (%) followed by the character’s ASCII HEX representation.

The multipart/form-data option does not perform character conversion and transfers the information as a compound MIME document. This must be used when using <input type="file">.

It also might be possible to use another encoding, such as text/plain with a mailed form, but in general you should be cautious about changing the enctype.

Standard Syntax

<form enctype="application/x-www-form-urlencoded|multipart/form-data|text/plain">

Browser Support


Attribute Values

Value Description
application/x-www-form-urlencoded (Default) All characters will be encoded before sending data.
multipart/form-data This value is necessary if the upload a file through the form. (img, video, etc...)
text/plain Sending data without any encoding. (Not recommended)
❮ HTML <form> tag