A contact form for GitHub Pages (no server required)
July 21, 2026
GitHub Pages will happily host your site forever, for free, on the strict condition that it never runs a single line of server code. That rules out every "just add a backend" tutorial on the internet. It does not rule out a contact form — because a form doesn't need your server, it just needs a URL to POST to.
1. Get the URL
Create a NormForms form (free).
You'll get an endpoint like https://normforms.com/f/x7Kp2mQ9RtLw.
2. Add the form to your page
Whether your Pages site is hand-written HTML or Jekyll, the answer is the same markup:
<form action="https://normforms.com/f/YOUR_TOKEN" method="POST"> <input type="text" name="name" placeholder="Your name"> <input type="email" name="email" placeholder="Your email"> <textarea name="message" placeholder="Your message"></textarea> <input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off"> <button type="submit">Send</button> </form>
Commit, push, done — the form works as soon as Pages rebuilds. The hidden
_gotcha field is the spam honeypot; leave it exactly as-is.
3. Lock it to your domain
In your form's settings, set your site's domain
(username.github.io or your custom domain). Submissions from
any other origin get silently dropped, which shuts down the bots that
POST directly at endpoints without ever visiting your page.
One honest caveat
Your form endpoint URL is visible in your repo if it's public — that's fine and by design (it's on your live page anyway, and it only accepts submissions from your domain). What you should never commit anywhere is an email password or SMTP credential, which is exactly the thing this setup means you'll never have.
Prefer not to touch HTML at all? Every NormForms form is also a hosted page at the same URL — link to it straight from your README.