HTML | <form> enctype Attribute

The HTML <form> enctype Attribute is used to specify that data that will be present in form should be encoded when submitting to the server. This type of attribute can be used only if method = “POST”.


<form enctype="value"> 

Attribute Value: This attribute contains three value which are listed below:

  • application/x-www-form-urlencoded: It is the default value. It encodes all the characters before sent to the server. It converts spaces into + symbols and special character into its hex value.
  • multipart/form-data: This value does not encode any character.
  • text/plain: This value convert spaces into + symbols but special characters are not converted.

Example: This Example illustrates the use of enctype attribute in <form> element.





<!DOCTYPE html>
    <title>Form enctype attribute</title>
<body style="text-align: center">
    <h1 style="color: green">GeeksforGeeks</h1>
    <h2>Form enctype Attribute</h2>
    <form action="#"
        First name:
        <input type="text" 
        <br> Last name:
        <input type="text"
        <br> Address:
        <input type="text" 
        <input type="submit"


Output :

Supported Browsers: The browsers supported by <form> enctype Attribute are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Apple Safari
  • Opera


My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.