HTML Input Types: Text, Email, Checkbox, Radio, and More
The HTML <input> tag has many types. Learn text, email, checkbox, radio and more, and how the right type makes forms easier to use on mobile.
- Reading time
- 2 min read
- Comments
- Discussion

On this page
- Common Input Types
- Text : for general short text
- Email : optimized for email addresses
- Password : hides the characters as you type
- Number : only allows numbers
- Date : shows a date picker in most browsers
- Checkbox : for multiple choices
- Radio : for selecting only one option
- Other Useful Input Types
- Quick Tips
Common Input Types
Text : for general short text
<input type="text" name="fullname" placeholder="Your name" />
Result
Email : optimized for email addresses
<input type="email" name="email" placeholder="you@example.com" />
Result
Password : hides the characters as you type
<input type="password" name="password" />
Result
Number : only allows numbers
<input type="number" name="age" min="1" max="100" />
Result
Date : shows a date picker in most browsers
<input type="date" name="birthday" />
Result
Checkbox : for multiple choices
<input type="checkbox" id="html" name="skill" value="html" /> <label for="html">HTML</label> <input type="checkbox" id="css" name="skill" value="css" /> <label for="css">CSS</label>
Result
Radio : for selecting only one option
<input type="radio" id="male" name="gender" value="male" /> <label for="male">Male</label> <input type="radio" id="female" name="gender" value="female" /> <label for="female">Female</label>
Result
Other Useful Input Types
<input type="tel" name="phone" /> <!-- Phone number --> <input type="url" name="website" /> <!-- Website URL --> <input type="file" name="upload" /> <!-- File upload --> <input type="color" name="favcolor" /> <!-- Color picker --> <input type="range" name="volume" min="0" max="100" /> <!-- Slider -->
Result
When to Use Each Type
| Type | Best Used For |
|---|---|
| text | Names, titles, general short text |
| Email addresses | |
| password | Passwords |
| number | Age, quantity, ratings |
| date | Birthdays, appointments |
| checkbox | Multiple options (select many) |
| radio | Single option (select only one) |
| file | Uploading images or documents |
| tel | Phone numbers |
| url | Website links |
Quick Tips
- Use the correct input type whenever possible, mobile devices will show the matching keyboard.
- Always pair inputs with a
<label>for better accessibility. - Radio buttons that belong together must share the same name.
- placeholder is just a short hint, not a replacement for a proper label.

Written by
Razak
Writes about the web, slowly, and builds small tools on the side.
Keep reading
Read next
1 minHTML
Best Practices for Writing Clean and Valid HTML
A collection of HTML best practices including proper indentation, naming, W3C validation, and common beginner mistakes you should avoid.
Read article
2 minHTML
Getting to Know HTML Iframe: How to Embed YouTube and Google Maps
How to use the HTML <iframe> tag to embed content from other sites, like a YouTube video or a Google Map, inside your own page.
Read article
1 minHTML
How to Create Forms in HTML for Beginners
A beginner's guide to HTML forms: how the <form> tag sends data for logins, sign-ups and contact messages, starting from the basics.
Read article
Discussion
Comments
Loading comments…