splitforms.com

HTML · FORM ATTRIBUTE

HTML form enctype: urlencoded vs multipart/form-data

Last reviewed

The enctype attribute on a <form> sets how the browser encodes the data of a method="post" submission. The default is application/x-www-form-urlencoded. Paste any body into the URL encoder and decoder to see exactly how a form is encoded. Use multipart/form-data whenever the form has an <input type="file"> (see the file input page). With method="get", enctype is ignored.

  • Live, editable example
  • Copy-paste snippet
  • Attributes & common mistakes
Live demo · nothing is sent

What gets submitted

Fill in the form above and press its button. The demo stops the request and lists every name=value pair the browser would send, plus the controls it leaves out.

With a free access key in the form, these fields land in your splitforms dashboard; access_key and botcheck are read by splitforms, not stored as lead data.

Edit the HTML and re-run it
Runs in a sandbox. Nothing is sent.

Minimal snippet

form-enctype-example.html
<form action="/upload" method="post" enctype="multipart/form-data">
  <input type="file" name="file">
</form>

Copy-paste code

HTML Form Enctype Attribute code you can paste today.

Replace YOUR_ACCESS_KEY with a key from your free splitforms dashboard. The form posts to one endpoint — submissions land in your inbox and dashboard with spam filtering built in.

Get free access key
form-enctype.html
<form action="https://splitforms.com/api/submit" method="POST" enctype="multipart/form-data">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">

  <label for="name">Name</label>
  <input type="text" id="name" name="name" autocomplete="name" required>

  <label for="email">Email</label>
  <input type="email" id="email" name="email" autocomplete="email" required>

  <label for="attachment">Attachment</label>
  <input type="file" id="attachment" name="attachment">

  <!-- Honeypot: hidden from people, bots fill it in -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">

  <button type="submit">Send</button>
</form>

Values

Which enctype values are there?

There are three: application/x-www-form-urlencoded (the default), multipart/form-data for forms with files, and text/plain. They only apply when the form uses method="post".

Which enctype values are there?
ValueWhat is sentUse it for
application/x-www-form-urlencodedThe default. name=value pairs joined with &; spaces and special characters are percent-encoded.Text-only forms.
multipart/form-dataEach field is a separate part, split by a boundary, with file contents included.Any form with a file input.
text/plainname=value lines with no escaping, so the data can't be decoded reliably.Debugging only, never in production.
Invalid or missing valueThe browser falls back to the default, application/x-www-form-urlencoded.Nothing: set a real value or leave it out.

Sources: WHATWG HTML Standard: enctype · MDN: HTMLFormElement.enctype

Attributes · <form enctype>

Which HTML Form Enctype Attribute attributes matter?

These attributes decide how the <form enctype> behaves and what actually gets emailed to your inbox when someone submits.

HTML Form Enctype Attribute attributes and what each one does
AttributeWhat it does
enctypeSet on the <form>. Picks how POST data is encoded: application/x-www-form-urlencoded (default), multipart/form-data or text/plain.
formenctypeSet on a submit button. Overrides the form's enctype for that button only.
methodenctype only applies when method="post". With get, the data always goes in the URL.
accept-charsetThe character encoding used for the data. Normally leave it out so the page's UTF-8 is used.

Common mistakes

HTML Form Enctype Attribute not working? Here's why.

Most broken forms come down to a few small mistakes with the <form enctype>. Check these before you ship, then forward every submission to Slack or a webhook.

  1. No multipart, no file

    Without enctype="multipart/form-data", a file input sends only the file name, not the file. There is no error; the upload just never arrives.

  2. enctype is ignored with GET

    A method="get" form always puts its data in the URL, whatever enctype says. File uploads need method="post".

  3. Don't set Content-Type with fetch()

    When you send a form with fetch(), pass the FormData object as the body and leave the Content-Type header out. The browser adds the multipart boundary; a hand-set header breaks the upload.

  4. Avoid text/plain

    text/plain doesn't escape the data, so a value with = or a line break can't be read back reliably. Use it only for debugging.

Sources: WHATWG HTML Standard: enctype · MDN: HTMLFormElement.enctype

Copy-paste ready

The HTML Form Enctype Attribute example below is a complete, working form — paste it into any HTML page and it submits, no edits to the markup required.

No backend to build

Your html form enctype attribute form posts to one endpoint. No server, PHP, or API route — accepted submissions are saved to your dashboard before owner notification email is attempted; delivery time and inbox placement depend on provider and recipient settings.

Where do uploaded files go?

File uploads need a paid splitforms plan with Storage connected (up to 5 files of 5 MB per submission); on the Free plan, text fields are saved and files are dropped.

How it works

How to add HTML Form Enctype Attribute to any page.

Copy the html form enctype attribute example, drop in your free access key, and paste it into any page — submissions start landing in your dashboard.

Copy the code

Copy the HTML Form Enctype Attribute example below.

Add your access key

Replace YOUR_ACCESS_KEY with a free splitforms key from the dashboard.

Paste into your site

Drop the form into any HTML page. Submissions arrive in your dashboard.

How SplitForms works

What happens after someone submits your form?

splitforms receives the submission, filters spam, saves it to your dashboard and emails you — then, on paid plans, sends it on to your webhooks and integrations. No backend infrastructure to build.

A SplitForms contact form submission launching straight to your inbox

Add your endpoint

Point your form to your unique SplitForms endpoint. That's it.

HTML form pointing at a SplitForms submit endpoint

Receive submissions

We instantly capture and organize every submission in your inbox.

Submissions inbox with searchable leads and status pills

Route anywhere

Send data to email, spreadsheets, CRMs, webhooks, and 7,000+ apps.

Generic integration tiles for email, sheets, chat, CRM, automate, and webhook

No credit card required. Set up in under 60 seconds.

Connect & automate

Where can submissions go besides email?

On paid plans, submissions can also go to Slack, Discord, Google Sheets, Notion, Airtable, Zapier or any signed webhook — and splitforms works on the platforms you build on, from WordPress and Shopify to Next.js. With Stripe connected, your forms can take payments too.

Connect your SplitForms form to Slack, Google Sheets, Mailchimp, Zapier and more
NewTake payments on your formsDeposits, bookings, order forms — submitters check out through Stripe and the money goes straight to your Stripe account. Included on every paid plan.See payment forms →Need time slots? Online booking →

Setup guides for the stacks you use

Questions

HTML Form Enctype Attribute questions, answered.

View all FAQs
What does enctype multipart/form-data mean?

It tells the browser to send each form field as its own part of the request body, separated by a boundary string. File contents can travel this way, so any form with a file input needs enctype="multipart/form-data" and method="post".

What is the default enctype of a form?

application/x-www-form-urlencoded. The browser joins the fields as name=value pairs with & and percent-encodes spaces and special characters. It is also used when enctype is missing or has an invalid value.

Do I need enctype if my form has no file input?

No. For a text-only form the default, application/x-www-form-urlencoded, is fine, so you can leave the attribute out. Add enctype="multipart/form-data" only when the form uploads files.

What does formenctype do?

formenctype goes on a submit button and overrides the form's enctype for submissions made with that button only. Other buttons keep using the form's own enctype.

Simple pricing

How much does splitforms cost?

Free gives you 500 submissions for $0 — no card, no time limit. Pro is $5/month for 5,000 submissions a month, and Annual is $49/year for 15,000 a month with every Pro feature.

Free

$0— 500 submissions
 

No card, no time limit

Best for testing

For side projects and indie devs.

  • 500 free submissions
  • Unlimited forms
  • Email notifications included
  • Smart spam filtering
  • Submissions dashboard
  • Redirect after submit
  • MCP server included

Annual

$49/ year
About $4.08 per month, billed yearly
Best value

Every Pro feature with triple the volume — $0.27 per 1,000 at full use.

  • 15,000 submissions per month
  • Unlimited forms
  • Everything in Pro
  • File uploads with 5 GB storage
  • 3 team seats
  • Priority email support

No credit card required on Free • Cancel anytime • Full pricing and FAQ