Open In App
Related Articles

HTML | enctype Attribute

Improve Article
Save Article
Like Article

This Attribute specifies that data 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">

Element: The enctype attribute is associated with <form> enctype element only. 
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.



<!DOCTYPE html>
        <title>enctype attribute</title>
            h1 {
            body {
        <h2>enctype Attribute</h2>
        <form action="#" method="post"
            First name: <input type="text" name="fname"><br>
            Last name: <input type="text" name="lname"><br>
            Address: <input type="text" name="Address"><br>
            <input type="submit" value="Submit">


Supported Browsers: The browser supported by enctype Attribute are listed below: 

  • Google Chrome 
  • Edge version 12 and above
  • Firefox 
  • Internet Explorer 
  • Opera 
  • Safari 


Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 21 Jun, 2022
Like Article
Save Article
Similar Reads
Complete Tutorials