splitforms.com

HTML · INPUT TYPE

HTML input type password: masked fields done right

Last reviewed

<input type="password"> masks each character, but the value is sent as plain text with the form, so serve the page over HTTPS. Use autocomplete="current-password" on sign-in and "new-password" on sign-up so password managers work, and enforce rules with minlength and pattern.

  • 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

password-input-example.html
<label for="password">Password</label>
<input type="password" id="password" name="password" autocomplete="new-password" minlength="8" required>

Copy-paste code

HTML Input Type Password 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
input-type-password.html
<form action="https://splitforms.com/api/submit" method="POST">
  <!-- Demo only: never email real account passwords through a form backend.
       This form just shows how the password field works. -->
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">

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

  <label for="password">Password</label>
  <input type="password" id="password" name="password"
         autocomplete="new-password" minlength="8" required
         pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}"
         title="At least 8 characters, with a number, a lowercase and an uppercase letter">

  <label>
    <input type="checkbox" id="show-password"> Show password
  </label>
  <script>
    document.getElementById("show-password").addEventListener("change", function (e) {
      document.getElementById("password").type = e.target.checked ? "text" : "password";
    });
  </script>

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

  <button type="submit">Sign up</button>
</form>

Key facts

How does a password input behave?

A password input works like a text field, but each character is drawn as a dot. The value is sent as plain text, so only HTTPS keeps it private on the way to the server.

How does a password input behave?
FactDetail
Shown on the pageAs dots or bullets, one per character typed.
Submitted valuePlain text, exactly as typed. Masking does not encrypt it, so HTTPS is required.
Line breaksRemoved from the value, like a text input.
ValidationOnly what you add: required, minlength, maxlength and pattern.
autocompleteUse current-password on sign-in and new-password on sign-up. See the autocomplete attribute.
Show-password toggleSwitch the input's type to text with JavaScript, then back to password.
HTTP pagesBrowsers warn people when a password field sits on a page served over plain HTTP.

Sources: WHATWG HTML Standard: Password state (type=password) · MDN: <input type="password">

Attributes · <input type="password">

Which HTML Input Type Password attributes matter?

These attributes decide how the <input type="password"> behaves and what actually gets emailed to your inbox when someone submits.

HTML Input Type Password attributes and what each one does
AttributeWhat it doesDocs
nameThe key the value is sent under. Without a name, the password is never sent.
autocompletecurrent-password for sign-in, new-password for sign-up or reset, so password managers fill or suggest the right one.MDN
minlengthThe fewest characters allowed, such as minlength="8".MDN
maxlengthThe most characters allowed. Keep it generous so long passphrases still fit.MDN
patternA regex the whole value must match, for example to require a number and an uppercase letter.MDN
requiredBlocks submit while the field is empty.MDN
inputmodeUse inputmode="numeric" for PIN fields so phones show a number keypad.

Common mistakes

HTML Input Type Password not working? Here's why.

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

  1. Masking is not encryption

    The dots only hide the value on screen. It is sent as plain text, so serve the form over HTTPS.

  2. A missing or wrong autocomplete breaks password managers

    Without current-password or new-password, managers may not fill the field or offer a strong password.

  3. A pattern without a title gives a vague error

    The browser only says the format doesn't match. Add a title that spells out the rule.

  4. Don't send real login passwords to a form backend

    Email and form backends store or forward the value as text. Hash passwords in your own auth system instead.

Sources: WHATWG HTML Standard: <input type="password"> · MDN: <input type="password">

Regex patterns for form fields

Use your validation patterns as you assemble a form with our HTML contact form code or HTML form generator.

Copy-paste ready

The HTML Input Type Password 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 input type password 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.

A form that really submits

Unlike a static reference snippet, this <input type="password"> form actually sends data to a free splitforms backend, with spam filtering built in.

How it works

How to add HTML Input Type Password to any page.

Copy the html input type password 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 Input Type Password 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 Input Type Password questions, answered.

View all FAQs
Is input type password encrypted?

No. It only hides the characters on screen. The value is sent as plain text with the form, so the page must use HTTPS to keep it private on the way to the server.

How do I add a show password button?

Add a checkbox or button that changes the input's type from password to text with JavaScript, and back again. Label it clearly, such as Show password.

How do I require a strong password in HTML?

Use minlength for the length and pattern for the mix of characters, plus a title that explains the rule. The splitforms password regex generator builds a ready pattern for you. Always check the rules on the server too.

What autocomplete value should a password field use?

Use current-password on sign-in forms and new-password on sign-up and password reset forms. This tells password managers whether to fill a saved password or suggest a new one.

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