Free tool

HTML form generator

Formgong team ·

This page writes a plain HTML form you can paste into any page. Start from the sample or build it field by field from 12 field types. No Tailwind, no Bootstrap, and the short script at the end is optional.

Short answer: An HTML form generator writes markup you can paste into any page. This one is also a field builder: add a field, pick one of 12 types, mark it required and move it. You get a plain form with labels, a scoped style block and a honeypot. Add your free key and it sends without any JavaScript.

HTML form generator online

Pick a starting form or edit the sample. Each row is one field: its label, its type, a Required box and, for lists, the options separated by commas. The arrows move a row up or down, Remove deletes it and Add field puts a new one at the end. The preview and the HTML tab change as you type. Paste your access key and the preview's button sends a real test, so you can see the form work before it goes on your site.

If you would rather describe the form in a sentence, open the AI box at the top. Its answer replaces the rows, and you edit them like any others.

New: open this form in the form builder to give it your site's colours and font and get the code for WordPress, Shopify, Wix or Webflow.

1. Start from a form

Or describe the form and let AI fill in the fields

Only your description goes to the AI model. The answer replaces the fields above it, and you can edit them like any other.

2. Edit the fields

3. Check the live preview

This is the HTML tab, rendered. Paste your access key in step 4 and the button sends a real test submission.

Get in touch

Form by Formgong

4. Add your access key

Every copy below uses it as you type. Until then the code has fk_your_access_key, which Formgong refuses.

We email you a sign-in code. Your first form and its key are ready once you enter it. Enter the code in this tab and the form's Connect page starts with these fields.

5. Copy the code

Plain HTML with a short style block. The script at the end is optional: it keeps visitors on the page and says sent only when Formgong answers success: true. Delete it and the browser posts the form on its own.

HTML
<style>
#fg-form{position:relative;box-sizing:border-box;display:grid;gap:16px;width:100%;max-width:520px;padding:28px;border:1px solid #dbe2ea;border-radius:8px;background:#fff;color:#0f172a;font:16px/1.5 system-ui,sans-serif}
#fg-form *{box-sizing:border-box}
#fg-form h2{margin:0;font-size:24px;line-height:1.3}
#fg-form .fg-field{display:grid;gap:6px;min-width:0;margin:0;padding:0;border:0}
#fg-form label,#fg-form legend{font-weight:500}
#fg-form legend{padding:0;margin-bottom:2px}
#fg-form input,#fg-form select,#fg-form textarea{width:100%;min-height:44px;padding:10px 12px;border:1px solid #64748b;border-radius:8px;background:#fff;color:inherit;font:inherit}
#fg-form textarea{min-height:120px;resize:vertical}
#fg-form .fg-choice{display:flex;align-items:center;gap:10px;font-weight:400}
#fg-form .fg-choice input{width:20px;min-height:20px;margin:0;flex-shrink:0}
#fg-form [aria-invalid=true]{border-color:#b91c1c}
#fg-form .fg-error{margin:0;color:#b91c1c;font-size:14px}
#fg-form .fg-status{margin:0}
#fg-form .fg-credit{margin:0;font-size:13px;text-align:center}
#fg-form .fg-credit a{color:#64748b}
#fg-form .fg-error:empty{display:none}
#fg-form button{min-height:48px;padding:12px 20px;border:0;border-radius:8px;background:#4338ca;color:#fff;font:inherit;font-weight:600;cursor:pointer}
#fg-form button:disabled{opacity:.7;cursor:wait}
#fg-form :focus-visible{outline:3px solid #4338ca;outline-offset:3px}
#fg-form .fg-trap{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
#fg-form select{appearance:none;-webkit-appearance:none;padding-inline-end:40px;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 20px) 50%,calc(100% - 15px) 50%;background-size:5px 5px,5px 5px;background-repeat:no-repeat}#fg-form select:dir(rtl){background-position:15px 50%,20px 50%}@media (forced-colors:active){#fg-form select{appearance:auto;-webkit-appearance:auto;background-image:none}}
</style>
<form id="fg-form" action="https://formgong.com/submit" method="POST">
  <h2>Get in touch</h2>
  <input type="hidden" name="access_key" value="fk_your_access_key">
  <input type="hidden" name="_lang" value="en">
  <div class="fg-field">
    <label for="fg-name">Name <span aria-hidden="true">*</span></label>
    <input type="text" id="fg-name" name="name" autocomplete="name" required aria-describedby="fg-name-error">
    <p class="fg-error" id="fg-name-error"></p>
  </div>
  <div class="fg-field">
    <label for="fg-email">Email <span aria-hidden="true">*</span></label>
    <input type="email" id="fg-email" name="email" autocomplete="email" required aria-describedby="fg-email-error">
    <p class="fg-error" id="fg-email-error"></p>
  </div>
  <div class="fg-field">
    <label for="fg-phone">Phone</label>
    <input type="tel" id="fg-phone" name="phone" autocomplete="tel" aria-describedby="fg-phone-error">
    <p class="fg-error" id="fg-phone-error"></p>
  </div>
  <div class="fg-field">
    <label for="fg-subject">Subject <span aria-hidden="true">*</span></label>
    <select id="fg-subject" name="subject" required aria-describedby="fg-subject-error"><option value="">Choose…</option><option value="A question">A question</option><option value="A quote">A quote</option><option value="Support">Support</option></select>
    <p class="fg-error" id="fg-subject-error"></p>
  </div>
  <div class="fg-field">
    <label for="fg-message">Message <span aria-hidden="true">*</span></label>
    <textarea id="fg-message" name="message" required aria-describedby="fg-message-error" rows="4"></textarea>
    <p class="fg-error" id="fg-message-error"></p>
  </div>
  <div class="fg-trap" aria-hidden="true"><label>Leave this empty <input type="text" name="botcheck" tabindex="-1" autocomplete="off"></label></div>
  <button type="submit">Send</button>
  <p class="fg-status" data-fg-status role="status"></p>
  <p class="fg-credit"><a href="https://formgong.com/en/?ref=badge&amp;utm_source=badge&amp;utm_medium=form&amp;utm_campaign=generator" target="_blank" rel="noopener">Form by Formgong</a></p>
</form>
<script>
// Optional. Without it the browser posts the form and Formgong shows its own thank-you or error page.
(function () {
  var form = document.getElementById("fg-form");
  var status = form.querySelector("[data-fg-status]");
  form.noValidate = true;
  form.addEventListener("submit", function (event) {
    event.preventDefault();
    var first = null, seen = {};
    Array.prototype.forEach.call(form.elements, function (field) {
      var id = field.getAttribute("aria-describedby");
      if (!id || seen[id]) return;
      seen[id] = true;
      var ok = field.checkValidity();
      field.setAttribute("aria-invalid", ok ? "false" : "true");
      document.getElementById(id).textContent = ok ? "" : field.validationMessage;
      if (!ok && !first) first = field;
    });
    if (first) { first.focus(); return; }
    var button = form.querySelector("[type=submit]");
    button.disabled = true;
    status.textContent = "Sending…";
    fetch(form.action, { method: "POST", headers: { Accept: "application/json" }, body: new FormData(form) })
      .then(function (response) { return response.json().catch(function () { return {}; }); })
      .then(function (data) {
        if (data.success === true) { form.reset(); status.textContent = "Thank you. Your message was sent."; }
        else status.textContent = data.message || "Could not send. Please try again.";
      })
      .catch(function () { status.textContent = "Could not reach the server. Check your connection and try again."; })
      .then(function () { button.disabled = false; });
  });
})();
</script>
<!-- Optional: fg.js counts views, starts and the field people stop at for your Formgong Analytics page. No cookies. Delete this line to turn it off. -->
<script src="https://formgong.com/fg.js" defer></script>
HTML form generators, checked 16 October 2026
This pageBasin HTML form generator
How you buildA starting form, then field rows you add, remove and move with arrows, or a descriptionTemplates, then add, remove and reorder fields
OutputPlain HTML with a scoped style block, plus Tailwind, Bootstrap 5, React, Vue and an AI builder promptPlain HTML for your own styles
Where it postsFormgong, after you add a keyBasin, after you add an endpoint
Account to copyNoneNone

The 12 field types and the HTML they become

  • Short text: <input>. If the label is Name, the code gets autocomplete="name".
  • Email: type="email", so the browser rejects an address without an @. A field labelled Email also gets autocomplete="email", and Formgong uses it as the reply-to address.
  • Phone: type="tel", which opens the number keypad on phones.
  • Long text: a <textarea>.
  • Dropdown: a <select> whose first option is empty, so a required list makes people choose.
  • Choose one: radio buttons inside a <fieldset> with a <legend>.
  • Checkboxes: several boxes under one name. Every ticked option is sent.
  • Single checkbox: one box with the value yes, for consent or “email me a copy”.
  • Number, Date and Website: type="number", type="date" and type="url", each with the browser's own picker and check.
  • File upload: type="file" for a PDF, JPEG or PNG up to 5 MB. The form gets enctype="multipart/form-data". Files only go through when Uploads is on for your form and the CAPTCHA widget from its Connect page is on the page.

The field name, the key you see in the inbox and in webhooks, is made from the label: “Ideal start date” becomes ideal_start_date. Two fields with the same label get _2 on the second name. A form can have up to 20 fields.

What is in the HTML

  • The form element. action is Formgong's /submit address and method="POST". That is all a browser needs to send it.
  • Two hidden inputs. access_key says which form this is. _lang sets the language of the thank-you page.
  • Labels. Every input has a label tied to it with for and id, so a click on the text focuses the field and screen readers read the name.
  • Error lines. Each field points at its own empty line with aria-describedby. When a field is wrong, the script writes the browser's own message there, so a screen reader reads it with the field.
  • Required fields. The required attribute. The browser stops an empty submit before anything is sent.
  • The select. Its first option is empty, so a required list makes people choose instead of sending the first item by accident.
  • The honeypot. A botcheck input moved off-screen and hidden from assistive tech.
  • A style block. A short block of CSS, every rule scoped to the form's own id. It cannot restyle the rest of your page.
  • An optional script. About thirty lines at the end. It keeps the visitor on the page and says “sent” only when Formgong answers success: true.

What makes a generated form actually send

On 2 November 2026 we took the 16 sites on Google's first page for “html form generator” and “contact form generator” in the US, asked each for the same contact form (name, email, message), and pasted the result into an empty page unchanged.

  • 0 of 16 gave a form that delivers a message as copied. 9 showed no code until we made an account. The other 7 posted to #, to a made-up action_page.php, to a placeholder sentence, or had no <form> at all.
  • 0 of those 7 added spam protection: no honeypot, no CAPTCHA.
  • 0 of 7 set autocomplete on name or email, so browsers cannot fill them in.
  • 2 of 7 failed an axe-core accessibility check: one had three fields with no label, one had button text below the contrast minimum. 3 of 7 marked no field required.

Our copy does not deliver as pasted either: it carries the placeholder key fk_your_access_key until you paste your own free key. Then it sends. We ran axe-core 4.10.2 (WCAG 2.1 A and AA) on each snippet as pasted, with the same page around it.

Five things make the difference, and every copy here has them:

  • A real target. action is Formgong's /submit address with method="POST".
  • Your key. The hidden access_key says which form this is. The placeholder fk_your_access_key is refused on purpose, so a forgotten key fails loudly instead of losing messages.
  • Field names. Each input has a name, made from its label. Without a name, the browser does not send the value.
  • An honest success message. The scripts say “sent” only when Formgong answers success: true. A wrong key, a full quota or a network error shows a message instead of a fake thank-you.
  • A honeypot. botcheck is off-screen and hidden from screen readers. Simple bots fill it, and Formgong files those posts as spam instead of sending them to you.

It works without JavaScript

Delete the script and the form still sends. The browser posts the fields. Formgong stores them and answers with a redirect to a thank-you page. It only does that after the submission is saved. A wrong key or a failed check leads to an error page that says what went wrong.

With the script, the visitor stays on your page. It sends the same fields with fetch, reads the JSON answer, and shows “sent” only when it says success: true. Anything else shows Formgong's own message, such as a wrong key. The HTML guide has the hidden fields Formgong understands, such as _redirect for your own thank-you page.

Styling it yourself

Delete the <style> block and the form falls back to your site's CSS. Nothing else depends on it. The field names and the hidden inputs are what make it work, so keep those.

If your site already loads a framework, the class names are one click away. The Tailwind form generator and the Bootstrap form generator open on those tabs with the same kind of form.

The HTML goes anywhere you can paste markup: a static site, GitHub Pages, a WordPress Custom HTML block, a Webflow or Framer embed, or a page an AI builder wrote.

Ready forms for a specific job

A generator starts from a general form. When yours is for one job, a ready form already asks the right questions. If you take orders, the t-shirt order form counts each size separately, and the cake order form asks for servings, the writing on top and allergies.

Landlords can start from the rental application form, which leaves out the questions fair housing rules do not allow. Every ready form is listed on the form templates page.

Free limits, email and storage

The HTML is free to copy. Submissions are delivered only after you replace the placeholder key.

Copying the code needs no account. AI generations are limited to 5 an hour and 10 a day for each network, plus 100 a day for the whole site. When a limit is hit, start from a form and edit the fields. Editing runs in your browser and does not call the model.

On the free plan, Telegram is instant and email is sent for every submission. The free plan is 250 submissions a month. Auto-reply is not on the free plan. Submission data is stored in the EU. Support is Formgong at support@formgong.com.

Your description is sent to the model so it can choose fields. It is not stored. Do not paste passwords, card numbers or other secrets.

Questions

What is an HTML form generator?

A tool that writes the form element and its fields for you. This one gives plain HTML with labels, required fields and a honeypot, and the action already points to Formgong.

Is there a free HTML form generator?

Yes, this page. Copying the code is free and needs no account. You need a free Formgong key only when you want the submissions delivered.

Which field types can I add?

Short text, email, phone, long text, dropdown, choose one (radio buttons), checkboxes, a single checkbox, number, date, website and file upload. Up to 20 fields per form.

Can I drag fields to reorder them?

On this page each row has up and down arrows instead, and they work with a keyboard. The form builder inside the Formgong dashboard also supports dragging.

Does the HTML form need JavaScript?

No. The script at the end is optional. Without it, the browser posts the form and Formgong shows a thank-you page, or an error page that says what went wrong.

Can I use my own CSS?

Yes. Delete the style block and your site's styles apply. Keep the field names, access_key, _lang and botcheck.

Where do the submissions go?

To your Formgong inbox after you add a real key. On the free plan, Telegram is instant and email is sent for every submission. The free plan is 250 submissions a month.

Sources

Checked on 23.11.2026 against these public pages: MDN: <form>, MDN: <label>, MDN: <input> types, Basin HTML form generator, Formcarry HTML form generator, Formgong HTML guide.

← Formgong