Live preview — try it:
Browsers do not display every control identically: date, time, month and week pickers, the color picker and the file button all look different from one browser to another, and some older browsers fall back to a plain text field for types they do not support. The value formats also differ by type: use YYYY-MM-DD for date, HH:MM for time, YYYY-MM for month and YYYY-Www for week. The min, max and step values follow the same formats. Pattern only applies to text-like types, multiple only to file and email, and placeholder only to types that show text.
What is the HTML5 Input Types Playground?
The HTML5 Input Types Playground is a free online tool that lets you try every HTML5 input type live — all 17 of them — and see the exact HTML that makes each one. You pick a type from a dropdown, such as email, date or range, and the tool shows you a working preview of that input, the attributes you can set on it, and the code to copy into your own form. It is made for anyone building a form: beginners learning which input type to use, bloggers adding a contact or signup form, and developers who want to check an attribute’s behaviour before they ship it.
HTML gives you far more than a plain text box. An <input type="email"> checks that what you type looks like an email address, an <input type="date"> opens a calendar picker, and an <input type="range"> shows a slider. Each type also brings the right keyboard on a phone — email shows the @ key, tel shows a number pad. Picking the right type makes a form easier to fill in and harder to fill in wrong, and it costs nothing extra. The hard part is remembering which type does what and which attributes apply to each one. That is what this playground is for: pick a type, try it, and read the code.
Everything runs in your browser. There is no sign-up, no account, and nothing you type leaves your device.
How to use the HTML5 Input Types Playground
- Pick an input type. The Input type dropdown lists all 17 types: text, email, password, number, date, time, datetime-local, month, week, color, range, checkbox, radio, file, search, tel and url. Email is selected by default.
- Try the attributes. The “Attributes — try them out” section offers required, multiple, disabled, placeholder, min, max, step and pattern. Only the attributes that apply to the type you picked stay usable — the rest are greyed out and disabled, so you can see at a glance what each type supports.
- Use the live preview. The preview shows a real, working input you can type into, pick from or slide. Underneath it, a “Current value” line shows what the input currently holds, updating as you use it.
- Read the HTML code. The HTML code box shows the exact
<input>tag for your type and attributes. Press Copy code to take it, or Reset to return to the sample input. - Switch types and compare. Change the dropdown and the preview, the attributes and the code all update together. That makes it easy to compare, for example, how
datediffers fromdatetime-local, or what changes when you addrequiredto a field.
Worked example: an email field that checks itself
Leave the type on email. The required checkbox is already ticked and the placeholder reads “you@example.com”, so the generated code is:
<input type="email" required placeholder="you@example.com">
Try it in the preview: type “not-an-email” and the browser will flag it, because the email type checks the format for you. Type a real address and the “Current value” line shows it. That is the whole point of choosing email over text — the browser does the checking, and on a phone the keyboard shows the @ key.
Now switch the type to number. The attributes change: placeholder stays, but min, max and step become available, while pattern is greyed out because it does not apply to numbers. Set min to 1, max to 10 and step to 1, and the code becomes:
<input type="number" required placeholder="you@example.com" min="1" max="10" step="1">
The placeholder is still there from the email example — clear it if you do not want it — and the number input now only accepts values from 1 to 10 in steps of 1.
Choosing the right input type for your form
Email, tel and url for contact details. Use email for email addresses, tel for phone numbers and url for website addresses. Each one brings the right keyboard on a phone and the right built-in checking in the browser: an email field rejects text without an @, a url field expects a web address. Using text for these fields works, but it throws away checking and the right keyboard for free.
Date, time, month and week for dates. A date field opens a calendar picker instead of making the visitor guess your format. The tool shows the value formats the browser expects: YYYY-MM-DD for date, HH:MM for time, YYYY-MM for month and YYYY-Www for week — and min, max and step use the same formats. Datetime-local combines a date and a time in one field, which is the right choice for booking a slot or setting a deadline.
Range and color for settings. A range input is a slider, ideal for a volume, a rating or any setting where an approximate value is enough — the tool defaults it to 0–100 with a starting value of 50. A color input opens the browser’s colour picker, which is the simplest way to let a visitor choose a colour without typing a hex code.
Tips for using the playground
- Greyed-out means “does not apply”. When an attribute is disabled, that attribute has no effect on the type you picked. Pattern only applies to text-like types, multiple only to file and email, and placeholder only to types that show text. The tool greys out the rest so you do not waste time setting an attribute the browser will ignore.
- Mind the value formats. Date, time, month and week values follow fixed formats: YYYY-MM-DD, HH:MM, YYYY-MM and YYYY-Www. The min, max and step values follow the same formats. If a date limit seems to do nothing, check that you typed it in the right format.
- Required is on by default for a reason. The sample input has required ticked, because most form fields should not be left empty. Try submitting a form with an empty required field and the browser stops you with its own message — no JavaScript needed. Untick it only for genuinely optional fields.
- Expect browsers to look different. Date, time, month and week pickers, the colour picker and the file button all look different from one browser to another, and some older browsers fall back to a plain text field for types they do not support. The behaviour — the checking and the value format — is the same, but the appearance is the browser’s choice, not yours.
- Test the value, not just the look. The “Current value” line under the preview shows exactly what the input holds — use it to check what a date picker returns or what a file input lists.
Frequently asked questions
How many input types are there?
HTML defines 17 input types in this tool: text, email, password, number, date, time, datetime-local, month, week, color, range, checkbox, radio, file, search, tel and url. Each one renders a different control and carries different built-in behaviour, from the email format check to the date calendar picker.
Why is an attribute greyed out?
Because it does not apply to the type you picked. Pattern only works on text-like types, multiple only on file and email, and placeholder only on types that display text. The tool disables the attributes that have no effect, so the code it generates contains only attributes the browser will actually honour.
Does the preview validate what I type?
Yes — the preview is a real input, so the browser’s own checking applies. An email field rejects text without an @, a number field with min 1 and max 10 rejects 20, and a required field stops an empty submission. That is the same checking your visitors will get when you use the generated code in your own form.
Will the input look the same in every browser?
No, and that is normal. The date, time, month and week pickers, the colour picker and the file button are drawn by the browser, so they look different in Chrome, Firefox and Safari. The behaviour and the value format stay the same — only the appearance varies.
Can I copy the code into my own form?
Yes. Press Copy code and the exact <input> tag for your type and attributes is copied to your clipboard. Paste it inside a <form> in your page, and add a <label> so visitors — and screen readers — know what the field is for.
Conclusion
The HTML5 Input Types Playground turns a long list of types and attributes into something you can touch: pick a type, try it live, and copy the code. Start with the email example, then compare date with datetime-local and test min, max and step on a number field. When you are ready to build the form around those inputs, the HTML Form Generator will put the whole form together for you.

