<p>I'm designing a database table and asking myself this question: <em>How long should the firstname field be?</em></p>
<p>Does anyone have a list of reasonable lengths for the most common fields, such as first name, last name, and email address?</p>

[{'answer_id': 20973, 'author': 'Loren Charnley', 'author_id': 2346, 'author_profile': 'https://Stackoverflow.com/users/2346', 'pm_score': 1, 'selected': False, 'text': '<p>Just looking though my email archives, there are a number of pretty long "first" names (of course what is meant by first is variable by culture).  One example is Krishnamurthy - which is 13 letters long.  A good guess might be 20 to 25 letters based on this.  Email should be <strong><em>much</em></strong> longer since you might have firstname.lastname@somedomain.com.  Also, gmail and some other mail programs allow you to use firstname.lastname+sometag@somedomain.com where "sometag" is anything you want to put there so that you can use it to sort incoming emails.  I frequently run into web forms that don\'t allow me to put in my full email address without considering any tags.   So, if you need a fixed email field maybe something like  25.25+15@20.3 in characters for a total of 90 characters (if I did my math right!).</p>\n'}, {'answer_id': 20984, 'author': 'SQLMenace', 'author_id': 740, 'author_profile': 'https://Stackoverflow.com/users/740', 'pm_score': -1, 'selected': False, 'text': "<p>it is varchar right? So it then doesn't matter if you use 50 or 25, better be safe and use 50, that said I believe the longest I have seen is about 19 or so. Last names are longer</p>\n"}, {'answer_id': 20986, 'author': 'Eric Z Beard', 'author_id': 1219, 'author_profile': 'https://Stackoverflow.com/users/1219', 'pm_score': 9, 'selected': False, 'text': '<p>I just queried my database with millions of customers in the USA.</p>\n\n<ul>\n<li><p>The maximum <strong>first name</strong> length was 46.  I go with 50. (Of course, only 500 of those were over 25, and they were all cases where data imports resulted in extra junk winding up in that field.)</p></li>\n<li><p><strong>Last name</strong> was similar to first name.</p></li>\n<li><p><strong>Email addresses</strong> maxed out at 62\ncharacters.  Most of the longer ones\nwere actually lists of email\naddresses separated by semicolons.</p></li>\n<li><p><strong>Street address</strong> maxes out at 95\ncharacters.  The long ones were all\nvalid.</p></li>\n<li><p>Max <strong>city</strong> length was 35.</p></li>\n</ul>\n\n<p>This should be a decent statistical spread for people in the US.  If you have localization to consider, the numbers could vary significantly.</p>\n'}, {'answer_id': 20988, 'author': 'kaybenleroll', 'author_id': 277, 'author_profile': 'https://Stackoverflow.com/users/277', 'pm_score': 0, 'selected': False, 'text': '<p>I usually go with:</p>\n\n<p><strong>Firstname</strong>: 30 chars<br />\n<strong>Lastname</strong>: 30 chars<br />\n<strong>Email</strong>: 50 chars<br />\n<strong>Address</strong>: 200 chars<br /></p>\n\n<p>If I am concerned about long fields for the names, I might sometimes go with 50 for the name fields too, since storage space is rarely an issue these days.</p>\n'}, {'answer_id': 21036, 'author': 'Kibbee', 'author_id': 1862, 'author_profile': 'https://Stackoverflow.com/users/1862', 'pm_score': 4, 'selected': False, 'text': '<p>I would say to err on the high side.  Since you\'ll probably be using varchar, any extra space you allow won\'t actually use up any extra space unless somebody needs it.  I would say for names (first or last), go at least 50 chars, and for email address, make it at least 128.  There are some really long email addresses out there.  </p>\n\n<p>Another thing I like to do is go to <a href="http://www.lipsum.com" rel="noreferrer">Lipsum.com</a> and ask it to generate some text.  That way you can get a good idea of just what 100 bytes looks like.  </p>\n'}, {'answer_id': 21053, 'author': 'Mike', 'author_id': 785, 'author_profile': 'https://Stackoverflow.com/users/785', 'pm_score': 4, 'selected': False, 'text': "<p>I pretty much always use a power of 2 unless there is a good reason not to, such as a customer facing interface where some other number has special meaning to the customer.  </p>\n\n<p>If you stick to powers of 2 it keeps you within a limited set of common sizes, which itself is a good thing, and it makes it easier to guess the size of unknown objects you may encounter.  I see a fair number of other people doing this, and there is something aesthetically pleasing about it.  It generally gives me a good feeling when I see this, it means the designer was thinking like an engineer or mathematician.  Though I'd probably be concerned if only prime numbers were used.  :)</p>\n"}, {'answer_id': 30535, 'author': 'ColinYounger', 'author_id': 1223, 'author_profile': 'https://Stackoverflow.com/users/1223', 'pm_score': 0, 'selected': False, 'text': "<p>If you need to consider localisation (for those of us outside the US!) and it's possible in your environment, I'd suggest:</p>\n\n<p>Define data types for each component of the name - NOTE: some cultures have more than two names! Then have a type for the full name,</p>\n\n<p>Then localisation becomes simple (as far as names are concerned).</p>\n\n<p><strong>The same applies to addresses, BTW - different formats!</strong></p>\n"}, {'answer_id': 31086, 'author': 'Ian Nelson', 'author_id': 2084, 'author_profile': 'https://Stackoverflow.com/users/2084', 'pm_score': 8, 'selected': False, 'text': '<p><a href="http://webarchive.nationalarchives.gov.uk/+/http://www.cabinetoffice.gov.uk/media/254290/GDS%20Catalogue%20Vol%202.pdf" rel="noreferrer">UK Government Data Standards Catalogue</a> details the UK standards for this kind of thing.\nIt suggests 35 characters for each of Given Name and Family Name, or 70 characters for a single field to hold the Full Name, and 255 characters for an email address.  Amongst other things..</p>\n'}, {'answer_id': 10103305, 'author': 'Micheal Mouner Mikhail Youssif', 'author_id': 1119452, 'author_profile': 'https://Stackoverflow.com/users/1119452', 'pm_score': 2, 'selected': False, 'text': '<pre><code>+------------+---------------+---------------------------------+\n|   Field    | Length (Char) |           Description           |\n+------------+---------------+---------------------------------+\n|firstname   | 35            |                                 |\n|lastname    | 35            |                                 |\n|email       | 255           |                                 |\n|url         | 60+           | According to server and browser |\n|city        | 45            |                                 |\n|address     | 90            |                                 |\n+------------+---------------+---------------------------------+\n</code></pre>\n\n<p><strong><em>Edit</em></strong>: Added some spacing</p>\n'}, {'answer_id': 11134267, 'author': 'Steve Chambers', 'author_id': 1063716, 'author_profile': 'https://Stackoverflow.com/users/1063716', 'pm_score': 2, 'selected': False, 'text': '<p>I wanted to find the same and the UK Government Data Standards mentioned in the accepted answer sounded ideal. However none of these seemed to exist any more - after an extended search I found it in an archive here: <a href="http://webarchive.nationalarchives.gov.uk/+/http://www.cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards.aspx" rel="nofollow">http://webarchive.nationalarchives.gov.uk/+/http://www.cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards.aspx</a>. Need to download the zip, extract it and then open default.htm in the html folder.</p>\n'}, {'answer_id': 19845397, 'author': 'Neil McGuigan', 'author_id': 223478, 'author_profile': 'https://Stackoverflow.com/users/223478', 'pm_score': 6, 'selected': False, 'text': '<h2>Some almost-certainly correct column lengths</h2>\n<pre><code>                            Min Max\n\nHostname                    1   255\nDomain Name                 4   253\nEmail Address               7   254\nEmail Address [1]           3   254\nTelephone Number            10  15      \nTelephone Number [2]        3   26  \nHTTP(S) URL w domain name   11  2083        \nURL [3]                     6   2083    \nPostal Code [4]             2   11\nIP Address (incl ipv6)      7   45\nLongitude                   numeric 9,6\nLatitude                    numeric 8,6\nMoney[5]                    numeric 19,4\n\n[1] Allow local domains or TLD-only domains\n[2] Allow short numbers like 911 and extensions like 16045551212x12345\n[3] Allow local domains, tv:// scheme\n[4] http://en.wikipedia.org/wiki/List_of_postal_codes. Use max 12 if storing dash or space\n[5] http://stackoverflow.com/questions/224462/storing-money-in-a-decimal-column-what-precision-and-scale\n</code></pre>\n<h2>A long rant on personal names</h2>\n<p>A personal name is either a Polynym (a name with multiple <em>sortable</em> components), a Mononym (a name with only one component), or a Pictonym (a name represented by a picture - this exists due to people like <a href="https://en.wikipedia.org/wiki/Prince_(musician)" rel="noreferrer">Prince</a>).</p>\n<p>A person can have multiple names, playing roles, such as LEGAL, MARITAL, MAIDEN, PREFERRED, SOBRIQUET, PSEUDONYM, etc. You might have business rules, such as &quot;a person can only have one legal name at a time, but multiple pseudonyms at a time&quot;.</p>\n<p>Some examples:</p>\n<pre><code>names: [\n  {\n    type:&quot;POLYNYM&quot;,\n    role:&quot;LEGAL&quot;,\n    given:&quot;George&quot;,\n    middle:&quot;Herman&quot;,\n    moniker:&quot;Babe&quot;,\n    surname:&quot;Ruth&quot;,\n    generation:&quot;JUNIOR&quot;\n  },\n  {\n    type:&quot;MONONYM&quot;,\n    role:&quot;SOBRIQUET&quot;,\n    mononym:&quot;The Bambino&quot; /* mononyms can be more than one word, but only one component */\n  },\n  {\n    type:&quot;MONONYM&quot;,\n    role:&quot;SOBRIQUET&quot;,\n    mononym:&quot;The Sultan of Swat&quot;\n  }\n]\n</code></pre>\n<p>or</p>\n<pre><code>names: [\n  {\n    type:&quot;POLYNYM&quot;,\n    role:&quot;PREFERRED&quot;,\n    given:&quot;Malcolm&quot;,\n    surname:&quot;X&quot;\n  },\n  {\n    type:&quot;POLYNYM&quot;,\n    role:&quot;BIRTH&quot;,\n    given:&quot;Malcolm&quot;,\n    surname:&quot;Little&quot;\n  },\n  {\n    type:&quot;POLYNYM&quot;,\n    role:&quot;LEGAL&quot;,\n    given:&quot;Malik&quot;,\n    surname:&quot;El-Shabazz&quot;\n  }\n]\n</code></pre>\n<p>or</p>\n<pre><code>names:[\n  {\n    type:&quot;POLYNYM&quot;,\n    role:&quot;LEGAL&quot;,\n    given:&quot;Prince&quot;,\n    middle:&quot;Rogers&quot;,\n    surname:&quot;Nelson&quot;\n  },\n  {\n    type:&quot;MONONYM&quot;,\n    role:&quot;SOBRIQUET&quot;,\n    mononym:&quot;Prince&quot;\n  },\n  {\n    type:&quot;PICTONYM&quot;,\n    role:&quot;LEGAL&quot;,\n    url:&quot;http://upload.wikimedia.org/wikipedia/en/thumb/a/af/Prince_logo.svg/130px-Prince_logo.svg.png&quot;\n  }\n]\n</code></pre>\n<p>or</p>\n<pre><code>names:[\n  {\n    type:&quot;POLYNYM&quot;,\n    role:&quot;LEGAL&quot;,\n    given:&quot;Juan Pablo&quot;,\n    surname:&quot;Fernández de Calderón&quot;,\n    secondarySurname:&quot;García-Iglesias&quot; /* hispanic people often have two surnames. it can be impolite to use the wrong one. Portuguese and Spaniards differ as to which surname is important */\n  }\n]\n</code></pre>\n<p>Given names, middle names, surnames can be multiple words such as <code>&quot;Billy Bob&quot; Thornton</code>, or <code>Ralph &quot;Vaughn Williams&quot;</code>.</p>\n'}, {'answer_id': 41374563, 'author': 'PodTech.io', 'author_id': 1842743, 'author_profile': 'https://Stackoverflow.com/users/1842743', 'pm_score': 3, 'selected': False, 'text': '<p>These might be useful to someone;</p>\n\n<pre><code>youtube max channel length = 20\nfacebook max name length   = 50\ntwitter max handle length  = 15\nemail max length           = 255 \n</code></pre>\n\n<p><a href="http://www.interoadvisory.com/2015/08/6-areas-inside-of-linkedin-with-character-limits/" rel="noreferrer">http://www.interoadvisory.com/2015/08/6-areas-inside-of-linkedin-with-character-limits/</a></p>\n'}, {'answer_id': 52347423, 'author': 'jrc', 'author_id': 594211, 'author_profile': 'https://Stackoverflow.com/users/594211', 'pm_score': 7, 'selected': True, 'text': '<p>W3C\'s recommendation:</p>\n\n<blockquote>\n  <p>If designing a form or database that will accept names from people\n  with a variety of backgrounds, you should <strong>ask yourself whether you\n  really need to have separate fields for given name and family name.</strong></p>\n  \n  <p>… Bear in mind that names in some cultures can be quite a lot longer\n  than your own. … <strong>Avoid limiting the field size for names in your\n  database</strong>. In particular, do not assume that a four-character\n  Japanese name in UTF-8 will fit in four bytes – you are likely to\n  actually need 12.</p>\n  \n  <p><a href="https://www.w3.org/International/questions/qa-personal-names" rel="noreferrer">https://www.w3.org/International/questions/qa-personal-names</a></p>\n</blockquote>\n\n<p>For database fields, <code>VARCHAR(255)</code> is a safe default choice, unless you can actually come up with a good reason to use something else. For typical web applications, performance won\'t be a problem. Don\'t prematurely optimize.</p>\n'}]
['https://Stackoverflow.com/questions/20958', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/437/']