Free tool · Runs in your browser

Free HTML Contact Form Generator

Build a contact form, preview it, and copy clean, accessible HTML. Pick your fields, add a honeypot for spam, and point the form at OSForms or any backend that accepts a POST. Nothing leaves your browser and there's no signup.

Fields

  1. 01NameName

    The key this value is stored under.

  2. 02EmailEmail

    The key this value is stored under.

  3. 03MessageMessage

    The key this value is stored under.

Add a field

Options

Where the browser sends the data, with method="POST". Paste your OSForms endpoint, or any backend that accepts a form POST.

Adds an off-screen input named hp_company_site that people never see (aria-hidden, tabindex=-1, autocomplete=off). In OSForms the honeypot name is set per form: open the form's Settings and enter hp_company_site as the Honeypot Field Name. It has to match exactly.

Styling
How it submits

What happens after submit

With a plain HTML post to OSForms, set a Redirect URL in the form’s Settings and the endpoint answers with a 303 redirect to your thank-you page. Without one, the browser shows the JSON response ({"success": true}).

Your form

Preview on a plain white page. Submitting is disabled here.

How an HTML contact form gets submitted

A <form> element on its own doesn't send email. When someone clicks submit, the browser collects every field that has a name attribute and sends it to the URL in action, using the method you set. For a contact form that's a POST with a body like name=Jane&email=jane%40example.com&message=Hi.

Something has to be listening at that URL. A static site on GitHub Pages or an S3 bucket can serve your HTML but can't accept a POST, so the submission goes nowhere. You have three options: write your own server route, deploy a serverless function, or point action at a form backend that stores the submission and forwards it. The tradeoffs are covered in How to Handle Form Submissions Without a Backend.

The generator above writes the form half. The name attributes become the keys you see in your inbox or spreadsheet, so keep them short and stable: email, not Your Email Address.

The contact form fields that matter

Most contact forms need three fields: name, email, and message. Each extra field costs you completions, so add phone, company, or a topic dropdown only when you'll act on the answer.

  • Email uses type="email", so phones show a keyboard with @ and the browser checks the format before sending.
  • Autocomplete tokens (name, email, tel, organization) let browsers fill fields in one tap.
  • Message is a <textarea>, so longer messages stay readable while typing.
  • Dropdowns start with an empty option, so required forces a real choice instead of quietly sending the first value.
  • Consent checkbox: add one if your privacy policy says you ask for it. It sends yes when ticked and nothing when it isn't.

Spam protection: honeypot and CAPTCHA

A honeypot is a field people can't see but bots fill in, because they complete every input they find. The generator moves it off-screen instead of using display:none (some bots skip fields hidden that way), takes it out of the tab order with tabindex="-1", hides it from screen readers with aria-hidden="true", and turns off autocomplete. The name hp_company_site is deliberately odd so browsers and password managers leave it alone.

In OSForms the honeypot is opt-in per form. Open the form's Settings and set Honeypot Field Name to hp_company_site; the names must match exactly. When a submission arrives with that field filled in, OSForms returns a normal success response but doesn't store it, so the bot gets no signal that it was caught.

Honeypots stop basic bots. For targeted spam, add a CAPTCHA. OSForms verifies Google reCAPTCHA (v2 and v3), hCaptcha, and Cloudflare Turnstile with your own secret key. Add the provider's widget to the form with your site key. OSForms picks the verifier from the token field the widget posts (g-recaptcha-response, h-captcha-response, or cf-turnstile-response) and strips the token before storing the submission. The secret is saved on the form as recaptchaSecret, one setting for all three providers, through PATCH /api/v1/forms/{id}. Each form is also rate limited per IP address, 10 submissions a minute by default.

Accessibility checklist

  • Every control has a visible <label> tied to it with matching for and id. Placeholders are hints, not labels: they vanish as soon as someone types.
  • Required fields carry the required attribute, so screen readers announce them. The visual asterisk is aria-hidden and explained in a note above the fields.
  • Inputs use the right type and autocomplete token (WCAG 1.3.5, Identify Input Purpose).
  • Focus stays visible. The basic CSS adds a 2px outline on :focus-visible.
  • Submit is a real <button type="submit">, so Enter and Space work without extra code.
  • In the fetch version the result message sits in a role="status" region, so screen readers read it out.
  • The honeypot is out of the tab order and hidden from assistive tech, so keyboard and screen reader users never land on it.

Connect the form to OSForms in 3 steps

  1. Create a form. Sign up free, create a form, and copy its endpoint: https://osforms.com/api/v1/f/your-slug.
  2. Paste the endpoint. Put it in the Form action URL field above, or replace YOUR_FORM_SLUG in the code you copied. In the form's Settings, set the Honeypot Field Name to hp_company_site. For the plain HTML version, also set a Redirect URL: OSForms then answers with a 303 redirect to your thank-you page instead of showing JSON.
  3. Add integrations. Send each submission to your inbox with your own Resend key (contact form email with Resend), append rows to a Google Sheet, or POST to a signed webhook. Every submission is also stored in your dashboard.

The free plan covers 100 submissions a month with every integration included. For a longer walkthrough that ends with email in your inbox, read How to Make an HTML Contact Form That Sends Email.

Frequently asked questions

01

Is this HTML form generator free?

Yes. It runs entirely in your browser, so nothing you type is sent anywhere and there is no signup. The output is plain HTML you can use on any site, with OSForms or with any other backend.

02

Does the generated contact form need JavaScript?

No. The default output is a plain HTML form that posts to your action URL and works with JavaScript turned off. The optional fetch version adds a small script that sends JSON and shows a success message on the page. If that script fails to load, the form still posts normally.

03

Where do contact form submissions go?

To the URL in the form's action attribute. With an OSForms endpoint, each submission is stored in your dashboard and forwarded to the integrations you connect: email through your own Resend key, a Google Sheet, or a webhook.

04

How do I stop spam on an HTML contact form?

Start with the honeypot field this generator adds, and set the same field name in your form backend so it can drop submissions that fill it in. If spam still gets through, add reCAPTCHA, hCaptcha, or Cloudflare Turnstile. OSForms verifies all three with your own secret key and rate limits each form per IP address.

05

Can I use the generated form without OSForms?

Yes. Change the action URL to any endpoint that accepts a POST, such as your own server route or a serverless function. The name attributes become the keys your backend receives. If you keep the honeypot, make your backend reject submissions where hp_company_site has a value.