I am designing a new app for iOS and I need to know what is the max characters allowed to use in a text field for when entering a new contact's first and last name so it wont have "..." and the full name will appear in one line at the contacts list?

Thanks for you help!!

closed as unclear what you're asking by Devin, maxathousand, Mayo, Benny Skogberg Jan 5 '17 at 12:44

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Can you clarify your question? It sounds like you're asking how big a text field needs to be to avoid truncating the content. – ElBel Dec 28 '16 at 22:09
  • There are other factors involved here. iOS devices have different screen widths, and iOS allows users to use larger display text. Are you talking about worst case, where the user has the smallest screen and the largest type? – Ken Mohnkern Dec 29 '16 at 15:00
  • let's go with the normal default case, on an iphone 5s screen size, when the user is not enlarging the font size – Adi Dec 29 '16 at 16:42

I solve this problem by running a simple statistical analysis of representative information that would go into the fields. The goal is to understand how long typical strings are so we can avoid overflows in text entry fields, which is a not-great experience.

As an example, for my current company's customer base*:

  • 99% of first names have 9 or fewer characters.
  • 99% of last names have 12 or fewer characters.

(We don't design to the max value because the max allowed name string is 255 characters; there's always some goofy data in the database that can throw off a max statistic.)

Here's how to do this analysis:

  1. If you already have a user base, pull a list of customer first and last names from your database for this analysis. 5,000 names should be adequate. Alternately, find a publicly available dataset – e.g. a phone book.
  2. firstname is one column / field, lastname is another column / field. Import the data into a spreadsheet.
  3. Create new columns firstname_len and lastname_len. If firstname is column A, fill firstname_len with a string length formula, e.g. =len(a2). Copy down into all cells. Repeat in another column for lastname.
  4. Assuming firstname_len is column C: Use =percentile(c2:c, .99) to calculate the 99th percentile of lengths for your data.

Here's an example of how to do this using street names (from a public dataset): https://docs.google.com/spreadsheets/d/1cUgXr1lRtv16C1ftTsYIqQT5AXq4pSHYk53_4Sl0ktc/edit?usp=sharing

(*) Please note that our user base is US-only and has certain demographic traits that aren't representative of the general population, so YMMV.

  • That's very helpful!! thank you very much for this! – Adi Dec 29 '16 at 14:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.