// embed guide

How to embed an HTML form on your website

Embedding a form means dropping third-party code into your page so visitors can submit data without you hosting a backend. This guide covers iframe embeds, JavaScript widgets, and native HTML with a remote action — plus when each approach fits.

Method 1: Script embed (recommended for most sites)

Visual form builders like forms.app and Tally provide a script tag plus a container element. The script injects the form and often handles responsive height.

forms.app script embed

<div data-formsapp-id="YOUR_FORM_ID" data-formsapp-embed></div>
<script src="https://forms.app/static/embed.js" defer></script>

Paste this into a raw HTML block in WordPress, Webflow, Notion sites, or any static page. Replace YOUR_FORM_ID with the ID from your forms.app publish panel.

Method 2: Iframe embed

Iframes sandbox the form completely. Styling is limited to what the builder allows, but setup is one line and Content-Security-Policy rules are straightforward.

Generic iframe pattern

<iframe
  src="https://form-provider.com/embed/FORM_ID"
  width="100%"
  height="500"
  frameborder="0"
  title="Contact form"
  loading="lazy">
</iframe>

Jotform and Cognito Forms both offer iframe codes from their publish screens. Set an explicit title for screen readers.

Method 3: Native HTML with remote action

When you want full CSS control, write the markup yourself and POST to a hosted endpoint. This is not an "embed" in the widget sense, but it is the pattern static-site developers prefer.

Formspree on static HTML

<form action="https://formspree.io/f/YOUR_ID" method="POST">
  <label>Email
    <input type="email" name="email" required autocomplete="email" />
  </label>
  <label>Message
    <textarea name="message" required></textarea>
  </label>
  <button type="submit">Send</button>
</form>

Basin and Getform work the same way with different endpoint URLs.

Where to paste embed code

CSP and performance tips

If you use a strict Content-Security-Policy, whitelist the embed provider's script and frame sources. Load embed scripts with defer. For iframes, use loading="lazy" when the form is below the fold.

Quick pick: Use forms.app script embeds when you need logic and spam tools. Use Formspree or Basin when you own the HTML and want minimal third-party JavaScript on the page.

Related reading