Skip to main content

HTML Form to cURL Command Converter

Paste a <form>'s HTML and get a ready-to-run curl command — parses action/method/enctype and every named input, handling multipart/form-data vs urlencoded, checkboxes, selects, Basic Auth and custom headers.

Input

Drop a file or browse
One file · text
Or

Paste a whole page or just the <form>…</form> markup.

A 1-based form number, or "all" to convert every form on the page.

Resolves a relative action ("/login") into a full URL. Ignored if action is already absolute.

One name=value per line — replaces the value/checked state found in the HTML for that field.

One header per line, formatted as "Key: Value".

Output

cURL Command
 
Parsed fields
NameTypeValueIncluded
No data yet
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/html-form-to-curl-converter \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<form action=\"/login\" method=\"post\">\n  <input na…",
    "form": "1",
    "baseUrl": "https://example.com",
    "overrides": "",
    "headers": "",
    "basicAuthUser": "",
    "basicAuthPass": "",
    "followRedirects": "true"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `html-form-to-curl-converter` tool (HTML Form to cURL Command Converter) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/html-form-to-curl-converter/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="HTML Form to cURL Command Converter — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

Found a login or search form in a page's source and need to hit the same endpoint from a terminal, a script, or a bug report? Paste the <form> markup here and get back a curl command that submits it the way a browser would — same URL, same method, same field names, same encoding. Everything runs in your browser; the HTML never leaves your machine.

How to use it

  1. Paste the form's HTML into the input box, or drop an .html file onto the uploader. A whole saved page works fine — anything outside <form>…</form> is ignored.
  2. If the action attribute is relative (/login rather than https://example.com/login), fill in Base URL so the generated command has a real address to hit.
  3. Check the Parsed fields table to see exactly what was found — every named input, its type, the value that will be sent, and whether it's actually included.
  4. Need different sample data than what's in the HTML? Add name=value lines to Override field values instead of editing the markup.
  5. Add any Extra headers, Basic Auth credentials, or toggle Follow redirects, then copy or download the command.

How fields are chosen

This follows the same rules a browser applies when you click submit:

  • Checkboxes and radio buttons are only included if they carry a checked attribute — an unchecked box is never sent, matching real form behavior.
  • <select> sends the option marked selected, or the first option if none is marked — never a blank value.
  • Disabled fields are always excluded.
  • <button type="reset">/type="button"> are UI-only and never submitted, so they're dropped.
  • <input type="file"> can't carry real file bytes from pasted markup, so it becomes a -F 'name=@/path/to/file' placeholder — edit the path before running.

Settings

  • Form to convert — a 1-based number (1, 2, 3…), or all to emit one curl command per form on the page.
  • Base URL — resolves a relative action into an absolute URL. Ignored once the action is already absolute.
  • Override field valuesname=value per line, applied after parsing. Useful for swapping in a real password or a fresh CSRF token without touching the HTML.

Why does GET produce a URL with a query string instead of -d?

Because that's what actually happens: a method="get" form never sends a body — the browser appends every field to the URL as a query string before navigating. Reproducing that with -d would hit a different code path on the server than a real form submission does.

What's the difference between the urlencoded and multipart output?

A plain form (or one with no enctype) submits application/x-www-form-urlencoded data, so each field becomes a --data-urlencode 'name=value' flag. Adding enctype="multipart/form-data" — required for file uploads — switches every field to -F 'name=value' instead, which curl sends as a multipart body.

Can it fetch a form from a URL?

No, and that's deliberate: nothing is uploaded or fetched, so the tool works on internal pages, logged-in dashboards and localhost just as well as on public sites. Use your browser's "View source" or DevTools → Copy element, then paste.

Building a curl command from scratch instead of pasting existing markup? cURL Command Builder covers manual URL/header/body entry with the same flags. To pull tabular data out of pasted HTML instead of a form, see HTML Table Extractor.

form parsercurl commandhttp requestapi testingmultipart form-dataurlencodedhtml parserweb scrapingdeveloper

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.