HTML Contact Form

Follow our simple HTML contact form code tutorial, or create any type of HTML form with 123FormBuilder. No coding required.

html contact form image

Create working contact forms in HTML

A contact form is a must if you want to hear from visitors and collect their contact details. Facebook pages and email newsletters are two key places to use contact forms. Here, we show you how to generate code for an HTML contact form, including a PHP script that will send form responses and contact details to you while providing a great user experience for your site visitors.

The HTML contact form code is located on the right. To see the result of the code, press the Result tab within the frame. Feel free to copy our HTML and CSS code and add it to your contact us page. Scroll down to see how the contact form code is generated.

free HTML contact form code

Creating a contact form in HTML: step by step

1. Create the HTML markup & CSS

First, we'll generate the HTML code for a basic contact form that asks for a Name, Email Address and Message. You can save a separate HTML file or copy and paste the HTML and CSS code.

2. Add the PHP form script

Once we have the HTML code for the contact form, we just need to add a PHP script to verify and process the form.

Creating the PHP script requires basic understanding of PHP, but you can use our free HTML contact form code generator to speed up the process.

To download the full code for the form, including the PHP script, click here.

In addition to HTML and PHP code, you can use jQuery to validate fields and show error messages on form submission. It's not mandatory, but it will help your HTML contact form users understand what they did wrong and help you collect information in the right format.

Build great contact forms with 123FormBuilder

That's all it takes to generate simple, fully functional HTML code for contact us forms. Pretty easy, right? If you need to take your HTML forms to the next level, you can do that too.

As soon as you sign up to 123FormBuilder, you can start building and customizing your HTML form with a few clicks. Our form builder automatically generates the HTML code that you can add to your contact page or any other web page. Add special form elements such as Google Maps, CAPTCHA, social buttons and more, plus customize your form design. All forms are mobile friendly so you can be assured you have a mobile responsive contact form.

Additional features include:

  • More form elements: first name, last name, email, dropdown list, short text (for subject line), multiple choice, Google map, page break (for pagination), custom submit.
  • More functionalities: CAPTCHA image verification, form validation, custom JavaScript
  • Beautiful contact form design: apply your own HTML and CSS code to style form elements and match your color scheme, or choose from our contact form templates

All of these features and more come with our simple HTML contact form code generator. Don't hesitate to try it out!

See our knowledge base for more step-by-step tutorials on creating powerful web forms with built-in form validation. Give that "contact us" form the feeling of a human being that is greeting and sending your visitors' messages to you.

contact form html coding

Ready-to-use HTML contact form templates

You can use our HTML contact form template or explore our free form templates for other types of HTML forms.

Contact form

Use this template
contact form html template

Add this contact form template to your website and get messages sent directly to your inbox. Modify this HTML contact form template easily, no programming skills needed!

Use this template

Sales lead form

Use this template
sales lead form html template

Use the sales lead form to generate leads and prospects for your business. Modify this lead form template with ease and publish it on your website.

Use this template

Support Request Form

Use this template
request form html template

Simplify the communication between your customers and your support team by sharing this support request form on your website.

Use this template

Sign up, get your own HTML contact form and publish it on the web.