Name fields on forms: what to ask and how to store it
Short answer: Most name problems on forms come from assumptions: that everyone has a first and last name, that names are short, that they use only English letters, or that the "last" name is the family name. Ask only for what you'll use, often one "Full name" field plus an optional "What should we call you?" field. Allow long names, accents, macrons, apostrophes, hyphens and spaces, never auto-correct capitals, and use the right autocomplete values so browsers can fill them.
Where name fields go wrong
Customers notice quickly when a form doesn't fit their name. Typical failures:
- A required "Last name" field for someone with a single name.
- A character limit that cuts off a long family name.
- Validation that rejects
Ngāti,O'Connor,Te Whāiti,Smith-JonesorMaría José. - Emails that greet people as "Dear Van" because the system split "van der Merwe" on the first space.
- Names forced into all capitals or "fixed" from
McDonaldtoMcdonald.
Each is a small insult to the customer and, in practice, a source of support calls, failed deliveries and mismatched records.
What a global perspective teaches
The W3C's internationalisation article on personal names around the world is a useful read before designing any form. It walks through how name order, structure and use differ: family names first in many East Asian names, patronymics in Icelandic names, multiple family names in Spanish-speaking countries, and names with no family name at all.
Its central advice is to ask whether you really need separate given-name and family-name fields. It suggests that, where possible, a single field is simpler, and that separate fields make sense only when you have a specific use for the parts. It also recommends not limiting field length in your database, and warns that a short name in some scripts can take several bytes per character in UTF-8.
Decide what you'll actually do with the name
Before choosing fields, list the uses:
| Use | What you need |
|---|---|
| Addressing a parcel | The name as it should appear on the label |
| Greeting in emails | What the person likes to be called |
| Sorting a staff list | Possibly a family name, or a "sort as" value |
| Matching an ID or payment card | The name exactly as on the document |
| Booking under a name | Whatever they'll give at the door |
Often one full-name field and one "preferred name" field cover everything. Ask for given and family names separately only if you genuinely need them, such as for a booking system that searches by surname.
Recommended field set for most businesses
A simple, inclusive approach:
- Full name (required): one field, as they'd like it written.
- What should we call you? (optional): a short name for greetings.
If you must split names, use neutral labels like "Given name(s)" and "Family name", make the family name optional, and don't assume which comes first.
Use the right autocomplete values
Browsers fill names more reliably with the correct tokens. The HTML standard's autofill section defines values including name for the full name, given-name, additional-name, family-name, honorific-prefix, honorific-suffix and nickname. Match each field to its token:
<label for="fullname">Full name</label>
<input id="fullname" name="fullname" autocomplete="name">
Wrong tokens, or none, lead to given names landing in surname fields.
Validation that doesn't reject real names
Keep checks minimal:
- Allow any letters, including accented letters, macrons and non-Latin scripts.
- Allow spaces, hyphens, apostrophes and full stops. Note that apostrophes come in straight and curly forms; accept both.
- Set generous maximum lengths, well above what you think you need, and match the database column.
- Trim surrounding spaces but don't collapse or reorder internal ones.
- Don't reject digits outright without thinking; some legitimate business names on forms include them.
Store names as UTF-8 throughout, including in your database, email templates and any export to delivery or accounting software. A name that displays correctly on your site but arrives as garbled characters on a courier label is still broken.
Don't "fix" capitalisation
Automatic capitalisation rules break real names: McKenzie, van Leeuwen, de la Cruz, MacLeod. Store what the customer typed. If you need a consistent format for printing, such as all capitals for labels, transform it at output only and keep the original.
Think about staff screens too
Customer-facing forms get the attention, but internal tools matter as much. Make sure staff can enter and edit names with the same rules, search by any part of a name, and see the preferred name prominently, so phone calls and front-desk greetings get it right. A booking screen that truncates long names after 15 characters undoes all the work on the public form.
Use names respectfully in messages
When greeting people:
- Use the preferred name if given; otherwise the full name or a neutral greeting.
- Avoid guessing a first name by splitting on spaces.
- Don't add titles like "Mr" or "Mrs" unless the customer chose one.
A worked example
Consider a hypothetical Rotorua tour operator whose booking form had required "First name" and "Last name" fields with a 20-character limit and letters-only validation. Some customers with macrons in their names saw errors, and confirmation emails greeted others oddly. The operator switched to a single "Full name" field with no restrictive validation, added an optional "What should we call you?" field, set the right autocomplete token, and checked UTF-8 handling all the way through to the booking export used by guides. Complaints about names stopped.
FAQ
Will a single name field break my CRM or email tool?
Many tools accept a full name. If one requires first and last names, map the preferred name to "first name" and the full name elsewhere, rather than splitting automatically.
How do I sort customers alphabetically?
Sort by full name, or add an optional "sort as" field for staff lists where it matters.
Should I support names in non-Latin scripts?
Yes, if any of your customers use them. UTF-8 storage and display make this straightforward.
Do payment forms need separate names?
Card forms usually want the cardholder name as printed, which is a separate field from the customer's own name.
If your forms are mangling or rejecting customers' names, ask us to review your sign-up and booking forms.