HTML contact form
Free HTML contact form code.
An HTML contact form is a <form> whose action points at a backend URL. Set it to https://splitforms.com/api/submit, add a hidden access_key, and every submission is spam-filtered, stored and emailed to you — no PHP or server code, 500 free submissions a month. Want the shortest route to a working Contact page? See the free website contact form.
- 500 free / month
- No PHP backend
- JavaScript optional

Key benefits
No backend needed
No PHP, Node, or server route of your own — the splitforms endpoint is the backend for your HTML contact form.
Spam filtered
A honeypot, time-trap, and rate limits screen bots out of every HTML form submission before your inbox.
Owner notification email
Accepted submissions are saved to the searchable dashboard before owner notification email is attempted. Delivery time and inbox placement depend on provider and recipient settings.
Copy-paste HTML
HTML contact form code, ready to paste.
Paste this HTML contact form into any page, point the action at the endpoint, and replace YOUR_ACCESS_KEY with the key from your dashboard. That's the whole integration — no server, no build step. Need more variations (dark mode, multi-column, file upload)? See the HTML contact form template collection.
Setup
How to add a contact form to any HTML page.
Three steps, about a minute. Sign up for a free access key, paste the form, and watch submissions land in your dashboard within seconds.
Get your free access key
Sign up at splitforms.com/login with your email. Your free form API key is generated instantly — no credit card required. Free includes 500 submissions a month.
Copy the contact form HTML
Copy the HTML contact form code below and paste it into any page on your website. Replace YOUR_ACCESS_KEY with the key from your dashboard.
Submit a test entry
Fill out the form and submit. The accepted submission is saved in your SplitForms dashboard before owner notification email is attempted. Delivery time and inbox placement depend on provider and recipient settings.
Line by line
What does each line of the contact form HTML do?
Seven parts, each with one job. The only one splitforms needs is the access key; everything else is ordinary HTML that any browser understands. See how the form action attribute works for the details of the first line.
- action + method="POST": where the browser sends the fields
- access_key: tells splitforms which form and inbox the post belongs to
- redirect (optional): your own thank-you page instead of the hosted one
- label for + id: ties each label to its input for screen readers
- name: the key each value is saved under — inputs without one are not sent
- botcheck + form_loaded_at: the honeypot and the 2-second time trap
- type="email" + required: the browser checks the basics before sending

What happens
What happens when someone submits your HTML contact form?
The moment a visitor hits Send, the browser's native POST hands the data to splitforms. From there it's received, filtered, stored, emailed, and — on paid plans — routed onward to your connected integrations, all without a server of your own.
- Received at the endpoint via a standard HTML form POST
- Spam filtered — honeypot, time-trap, content heuristics, rate limits
- Stored in a searchable dashboard, exportable on paid plans
- Owner notification email is attempted after the submission is saved; delivery varies by provider and recipient settings
- Routed to Slack, Discord, Sheets, Notion, or a webhook on paid plans

Spam protection
How do you stop spam on an HTML contact form?
The pasted form already ships with a botcheck honeypot, and splitforms adds a time-trap, content heuristics, and rate limiting on every request. It all runs server-side, so you can keep the page entirely JavaScript-free — a working reCAPTCHA alternative with nothing for visitors to solve.
- Honeypot field bots fill in but humans never see
- form_loaded_at time-trap drops posts sent under 2 seconds after load
- Rate limiting at 6 submissions per minute per IP, per form
- Optional reCAPTCHA v2 or Turnstile with your own keys — not required

Customize
How do you customize an HTML contact form?
Every field name becomes a column in your dashboard, so adding fields is just adding inputs. Prefer a styled starting point? See the Tailwind CSS forms guide for a dark-mode-ready template with validation states.
- Add fields — each name becomes a dashboard column
- Redirect visitors to a thank-you page with a hidden redirect field
- Set the notification email subject with a hidden subject field
- Reply straight to the visitor with a hidden replyto field
- Attach files with an <input type="file"> on paid plans

How do I create a contact form in HTML?
Create a <form> element, set the action attribute to a form backend endpoint like https://splitforms.com/api/submit, add a hidden input with your access key, then add your input fields (name, email, message) and a submit button. The form backend handles storage, email notifications, and spam filtering — no server-side code required.
Can I use an HTML contact form without a backend?
Yes. Point your form's action attribute at a hosted form backend like splitforms. The backend receives the POST request, stores the submission, sends you an email, and handles spam filtering. You don't need PHP, Node.js, Python, or any server-side code of your own.
Does the HTML contact form code work on static sites?
Yes. The form is a standard HTML form POST. It works on any static site host including GitHub Pages, Netlify, Vercel, Cloudflare Pages, Amazon S3, and any web server that can serve HTML files.
Do I need JavaScript for an HTML contact form?
No. The form uses native HTML form submission. The one-line script in the example only fills the form_loaded_at time-trap field; delete it and the form still works, the time trap simply does not run. JavaScript is otherwise optional, for custom validation or AJAX submission.
How do I protect my HTML contact form from spam?
The form above includes a botcheck honeypot (a hidden input bots fill in but people never see) and a form_loaded_at timestamp: posts sent less than 2 seconds after the page loaded are dropped. splitforms also runs server-side content scoring and rate limiting (6 submissions a minute and 20 per 15 minutes per IP, per form) on every request. reCAPTCHA v2 or Cloudflare Turnstile can be added with your own keys, but neither is required.
Is the HTML contact form code actually free?
Yes. The splitforms Free plan covers unlimited forms, 500 submissions a month (resetting every month), owner notification emails and spam filtering, with no credit card. Pro is $5/month for 5,000 submissions a month and adds exports, webhooks, integrations, auto-replies, CC/BCC recipients and file uploads.
Show 2 more questions
Can I add a file upload field to my HTML contact form?
Yes — add <input type="file" name="attachment"> and enctype="multipart/form-data" on the form tag. File storage is on paid plans and supports up to 5 files per submission, 5 MB each; on Free the text fields are saved and files are dropped.
How do I get notified when someone submits the form?
Email notifications to the form owner are included free on every plan, including Free. You'll get an email with the submission details as soon as someone submits, no setup required beyond your access key.
Simple pricing
Start free. Upgrade when you need more.
Ready to add your HTML contact form?
Get your free access key and start collecting form submissions in under 60 seconds — 500 submissions a month, free to start, no credit card required.
- No credit card required
- 500 free submissions
- Setup in minutes

