# AI form generation

Build forms from a prompt, PDF, or screenshot with AI.

## AI form generation

Skip the blank canvas. Describe the form you need — or attach a file — and AI builds the fields, validation, and conditional logic in seconds.

<h2 id="how">How it works</h2>
<p>
  Open the <a href="/ai/using-ai#getting-started">AI chat panel</a> and describe the form you want. formbase turns your prompt into a
  structured form with pages, fields, types, validation, helper text, and branching logic. The result is fully editable like any form you
  build by hand.
</p>
<p>AI can create a brand-new form or add to one you already have open.</p>

<h2 id="tips">Writing good prompts</h2>
<p>Be specific about purpose, audience, and required fields. Mention payment, file uploads, and logic explicitly.</p>

```
Job application for a senior backend role.
Collect name, email, country (dropdown), years of experience,
GitHub URL, resume PDF upload (required), cover letter (optional,
long text), and ask if they need visa sponsorship — show a
follow-up question if yes.
```

```
RSVP form for a 50-person dinner.
Ask name, email, party size (1–4), dietary restrictions
(multi-select: vegetarian, vegan, gluten-free, none),
and a free-text field for special requests.
```

> 💡 **Short prompts work too**
> <p>
>     Try <em>"Help me create a form"</em> and AI asks follow-up questions. But the more detail you give upfront, the better the first draft.
>   </p>

<h2 id="files">Generate from a file</h2>
<p>
  Attach an image, PDF, or screenshot to your message and AI converts it into a structured form. This works well for paper forms, competitor
  screenshots, or wireframes.
</p>
<ul>
  <li>Supported formats: JPEG, PNG, GIF, WebP, PDF. Audio and video are not accepted.</li>
  <li>Up to 5 files per message</li>
  <li>Per file: JPEG, PNG, and WebP up to 3 MB (formbase shrinks them before upload), GIF and PDF up to 1 MB</li>
  <li>4.5 MB total across the whole conversation, counted after shrinking</li>
</ul>
<p>
  AI reads the layout and fields from your file, then builds matching questions in formbase. Review the result and refine with follow-up
  messages.
</p>
> 💡 **Dense PDFs**
> <p>
>     Switch to Claude Sonnet 4.5 from the model button before sending a long or densely laid out PDF — it reads complex documents more
>     reliably. See <a href="/ai/using-ai#models">choosing a model</a>.
>   </p>

<h2 id="refine">Refining the output</h2>
<p>
  After generation, keep chatting to iterate. AI sees your form's current state, so every follow-up is context-aware. You can also edit
  fields directly in the editor between messages.
</p>
<ul>
  <li>
    <em>"Add a phone number field after email."</em>
  </li>
  <li>
    <em>"Make question 3 required."</em>
  </li>
  <li>
    <em>"If the country question is not US, show the visa sponsorship question."</em>
  </li>
  <li>
    <em>"Split this into two pages."</em>
  </li>
</ul>
<p>
  For the full list of what AI chat can do beyond generation — translations, submissions analysis, workspace management — see{' '}
  <a href="/ai/using-ai">Using AI</a>.
</p>

<h2 id="credits">Credit usage</h2>
<p>
  Form generation spends credits based on prompt length and form complexity. Attachments count too — a PDF is a lot of text. See{' '}
  <a href="/ai/ai-credits-usage">AI credits & usage</a> for pricing and packages.
</p>

<h2 id="next-steps">Next steps</h2>
<div class="not-prose grid gap-3 sm:grid-cols-2">
  - [AI skills](/ai/ai-skills) — Reusable instructions and knowledge for AI
  - [AI credits & usage](/ai/ai-credits-usage) — Pricing, packages, and balance
  - [Connect an AI agent](/guides/ai-agents/connect) — Use formbase from Claude, ChatGPT, or Cursor
  - [Conditional logic](/building-forms/conditional-logic) — Show, hide, and skip based on answers
</div>
