HTML Form Generator
Choose a type for each field, enter its label and mark the required ones — the ready HTML form code appears below right away. Copy it, or open it in the HTML Editor to see the form and add styles.
Use cases
- Quickly putting together a contact, booking or order form with correct markup
- Seeing how fields are tied to their labels with label for and id
- Getting a starting form and refining it in the HTML Editor
FAQ
The generator only creates HTML code. For the data to go somewhere, the action attribute must point to a handler on a server — a script on your site or a form-handling service. The tool itself sends nothing: the code is built in your browser.
A label tied to its field with for and id is read out by screen readers, and clicking the label focuses the field or toggles the checkbox. A placeholder is no replacement: it disappears as soon as you start typing.
The browser won't submit the form while a required field is empty and shows a message itself. For email and number it also checks the format. It is a convenience for users, not protection: data still has to be validated on the server.
For required to work on a <select>, the first option must be a placeholder with an empty value, such as "— choose —". Otherwise the first real option is always selected and the browser treats the field as filled.
With get, the data is appended to the page URL — that's what search forms do. With post, it travels in the request body and stays out of the address bar and browser history; use post for contact, sign-in and sign-up forms.
Click "Open in HTML Editor": the form opens as a complete HTML document where you can add a <style> block and see the result right away.
Related tools
Build a contact form
Practice exercise: build a contact form with name, email, and message fields.
Build a registration form with built-in validation
Practice exercise: build a course sign-up form with fieldset, input types, required, pattern and minlength — validation without JavaScript.
Build a login form
Practice exercise: fix a broken sign-in form — email and password with autocomplete for password managers, remember me and a forgot-password link.
Forms
form, input, label, button — the basic building blocks of a data-entry form.
The <form> tag
The action, method, and enctype attributes of the <form> tag, with an example.
The <input> tag
Types and attributes of the <input> tag: type, name, value, required, pattern.
The <label> tag
The for attribute of <label>, linking a caption to an input.
HTML Table Generator
Quickly generate HTML table markup with a given number of rows and columns.
HTML Validator
Check HTML for unclosed tags, duplicate ids, and other errors with the Nu Html Checker. Your code is sent to our server for checking.