[{"data":1,"prerenderedAt":607},["ShallowReactive",2],{"guide-age-calculation-legal-requirements":3},{"id":4,"title":5,"body":6,"date":599,"description":600,"extension":601,"meta":602,"navigation":410,"path":603,"readingTime":414,"seo":604,"stem":605,"__hash__":606},"guides\u002Fguides\u002Fage-calculation-legal-requirements.md","Age Calculation for Legal Requirements",{"type":7,"value":8,"toc":580},"minimark",[9,14,18,22,25,36,39,44,52,95,98,102,105,185,189,192,195,296,300,367,371,374,378,447,451,466,476,480,483,489,493,496,534,537,541,563,567,576],[10,11,13],"h2",{"id":12},"when-exact-age-matters","When Exact Age Matters",[15,16,17],"p",{},"Most of the time, knowing you are \"about 30\" is fine. But legal systems require precise age calculation. A single day determines whether someone can sign a contract, buy alcohol, or collect retirement benefits. Getting it wrong has real consequences: lawsuits, regulatory fines, or denied benefits.",[10,19,21],{"id":20},"the-legal-age-rule-the-birthday-threshold","The Legal Age Rule: The Birthday Threshold",[15,23,24],{},"In nearly all jurisdictions, you reach an age on your birthday — not the day before. You become 18 at the start of the day you were born 18 years ago.",[26,27,32],"pre",{"className":28,"code":30,"language":31},[29],"language-text","Legal age reached on: Birth date + N years\n","text",[33,34,30],"code",{"__ignoreMap":35},"",[15,37,38],{},"Someone born on June 15, 2008, turns 18 on June 15, 2026. On June 14, 2026, they are still 17.",[40,41,43],"h3",{"id":42},"the-leap-year-edge-case","The Leap Year Edge Case",[15,45,46,47,51],{},"What about someone born on February 29? Most legal systems use ",[48,49,50],"strong",{},"February 28"," as the age-reached date in non-leap years:",[53,54,55,71],"table",{},[56,57,58],"thead",{},[59,60,61,65,68],"tr",{},[62,63,64],"th",{},"Birth Date",[62,66,67],{},"18th Birthday (Non-Leap)",[62,69,70],{},"18th Birthday (Leap)",[72,73,74,85],"tbody",{},[59,75,76,80,83],{},[77,78,79],"td",{},"Feb 28, 2008",[77,81,82],{},"Feb 28, 2026",[77,84,82],{},[59,86,87,90,92],{},[77,88,89],{},"Feb 29, 2008",[77,91,82],{},[77,93,94],{},"Feb 29, 2028",[15,96,97],{},"Some jurisdictions (including the UK) explicitly define February 28 as the legal birthday for leap-day births in common years. Always check local law.",[10,99,101],{"id":100},"age-of-majority-by-jurisdiction","Age of Majority by Jurisdiction",[15,103,104],{},"The age at which a person gains full legal capacity varies:",[53,106,107,120],{},[56,108,109],{},[59,110,111,114,117],{},[62,112,113],{},"Region",[62,115,116],{},"Age of Majority",[62,118,119],{},"Notes",[72,121,122,133,144,155,165,175],{},[59,123,124,127,130],{},[77,125,126],{},"United States",[77,128,129],{},"18 (most states)",[77,131,132],{},"Alabama and Nebraska: 19; Mississippi: 21",[59,134,135,138,141],{},[77,136,137],{},"United Kingdom",[77,139,140],{},"18",[77,142,143],{},"Scotland: 16 for some purposes",[59,145,146,149,152],{},[77,147,148],{},"Canada",[77,150,151],{},"18 (most provinces)",[77,153,154],{},"BC, NS, NB, NL, NWT, Yukon: 19",[59,156,157,160,162],{},[77,158,159],{},"Australia",[77,161,140],{},[77,163,164],{},"All states and territories",[59,166,167,170,172],{},[77,168,169],{},"Japan",[77,171,140],{},[77,173,174],{},"Lowered from 20 in 2022",[59,176,177,180,182],{},[77,178,179],{},"Germany",[77,181,140],{},[77,183,184],{},"Full capacity; limited at 16",[10,186,188],{"id":187},"regulatory-age-requirements","Regulatory Age Requirements",[15,190,191],{},"Different ages apply depending on the regulated activity:",[40,193,126],{"id":194},"united-states",[53,196,197,210],{},[56,198,199],{},[59,200,201,204,207],{},[62,202,203],{},"Activity",[62,205,206],{},"Minimum Age",[62,208,209],{},"Governing Law",[72,211,212,222,233,243,253,264,275,286],{},[59,213,214,217,219],{},[77,215,216],{},"Voting",[77,218,140],{},[77,220,221],{},"26th Amendment",[59,223,224,227,230],{},[77,225,226],{},"Alcohol purchase",[77,228,229],{},"21",[77,231,232],{},"National Minimum Drinking Age Act",[59,234,235,238,240],{},[77,236,237],{},"Tobacco purchase",[77,239,229],{},[77,241,242],{},"T21 (2019)",[59,244,245,248,250],{},[77,246,247],{},"Federal employment",[77,249,140],{},[77,251,252],{},"Varies by position",[59,254,255,258,261],{},[77,256,257],{},"Driver's license",[77,259,260],{},"16–18",[77,262,263],{},"State-dependent",[59,265,266,269,272],{},[77,267,268],{},"Military enlistment",[77,270,271],{},"17 (with consent)",[77,273,274],{},"10 USC §505",[59,276,277,280,283],{},[77,278,279],{},"Social Security (early)",[77,281,282],{},"62",[77,284,285],{},"SSA rules",[59,287,288,291,294],{},[77,289,290],{},"Medicare",[77,292,293],{},"65",[77,295,285],{},[40,297,299],{"id":298},"european-union","European Union",[53,301,302,314],{},[56,303,304],{},[59,305,306,308,311],{},[62,307,203],{},[62,309,310],{},"Typical Minimum Age",[62,312,313],{},"Variation",[72,315,316,325,335,345,356],{},[59,317,318,320,322],{},[77,319,216],{},[77,321,260],{},[77,323,324],{},"Austria: 16; most: 18",[59,326,327,330,332],{},[77,328,329],{},"Alcohol (beer\u002Fwine)",[77,331,260],{},[77,333,334],{},"Germany: 16; UK: 18",[59,336,337,340,342],{},[77,338,339],{},"Alcohol (spirits)",[77,341,140],{},[77,343,344],{},"EU-wide minimum",[59,346,347,350,353],{},[77,348,349],{},"Driving",[77,351,352],{},"17–18",[77,354,355],{},"Varies by country",[59,357,358,361,364],{},[77,359,360],{},"Employment (full-time)",[77,362,363],{},"15–16",[77,365,366],{},"EU Directive 94\u002F33\u002FEC",[10,368,370],{"id":369},"age-verification-in-software","Age Verification in Software",[15,372,373],{},"Applications that enforce age restrictions must calculate age accurately:",[40,375,377],{"id":376},"correct-calculation","Correct Calculation",[26,379,383],{"className":380,"code":381,"language":382,"meta":35,"style":35},"language-javascript shiki shiki-themes github-light github-dark","function calculateAge(birthDate, referenceDate = new Date()) {\n  let age = referenceDate.getFullYear() - birthDate.getFullYear();\n  const monthDiff = referenceDate.getMonth() - birthDate.getMonth();\n\n  if (monthDiff \u003C 0 || (monthDiff === 0 && referenceDate.getDate() \u003C birthDate.getDate())) {\n    age--;\n  }\n\n  return age;\n}\n","javascript",[33,384,385,393,399,405,412,418,424,430,435,441],{"__ignoreMap":35},[386,387,390],"span",{"class":388,"line":389},"line",1,[386,391,392],{},"function calculateAge(birthDate, referenceDate = new Date()) {\n",[386,394,396],{"class":388,"line":395},2,[386,397,398],{},"  let age = referenceDate.getFullYear() - birthDate.getFullYear();\n",[386,400,402],{"class":388,"line":401},3,[386,403,404],{},"  const monthDiff = referenceDate.getMonth() - birthDate.getMonth();\n",[386,406,408],{"class":388,"line":407},4,[386,409,411],{"emptyLinePlaceholder":410},true,"\n",[386,413,415],{"class":388,"line":414},5,[386,416,417],{},"  if (monthDiff \u003C 0 || (monthDiff === 0 && referenceDate.getDate() \u003C birthDate.getDate())) {\n",[386,419,421],{"class":388,"line":420},6,[386,422,423],{},"    age--;\n",[386,425,427],{"class":388,"line":426},7,[386,428,429],{},"  }\n",[386,431,433],{"class":388,"line":432},8,[386,434,411],{"emptyLinePlaceholder":410},[386,436,438],{"class":388,"line":437},9,[386,439,440],{},"  return age;\n",[386,442,444],{"class":388,"line":443},10,[386,445,446],{},"}\n",[40,448,450],{"id":449},"common-bug-year-only-subtraction","Common Bug: Year-Only Subtraction",[26,452,454],{"className":380,"code":453,"language":382,"meta":35,"style":35},"\u002F\u002F WRONG — fails for people who haven't had their birthday yet this year\nconst age = referenceDate.getFullYear() - birthDate.getFullYear();\n",[33,455,456,461],{"__ignoreMap":35},[386,457,458],{"class":388,"line":389},[386,459,460],{},"\u002F\u002F WRONG — fails for people who haven't had their birthday yet this year\n",[386,462,463],{"class":388,"line":395},[386,464,465],{},"const age = referenceDate.getFullYear() - birthDate.getFullYear();\n",[15,467,468,469,472,473,475],{},"On March 1, 2026, someone born July 15, 2008, is ",[48,470,471],{},"17"," — not ",[48,474,140],{},". Year-only subtraction gives 18, incorrectly passing age checks.",[40,477,479],{"id":478},"another-bug-time-zone-mismatch","Another Bug: Time Zone Mismatch",[15,481,482],{},"If the server is in UTC and the user is in PST, a birth date of January 1 might be stored as December 31 UTC. The age calculation runs against the wrong date.",[15,484,485,488],{},[48,486,487],{},"Fix",": Always compute age against the user's local date, not the server's UTC date.",[10,490,492],{"id":491},"age-in-completed-years-vs-age-at-next-birthday","Age in Completed Years vs. Age at Next Birthday",[15,494,495],{},"Legal systems sometimes ask different questions:",[53,497,498,511],{},[56,499,500],{},[59,501,502,505,508],{},[62,503,504],{},"Question",[62,506,507],{},"Meaning",[62,509,510],{},"Example (born July 15, 2008)",[72,512,513,524],{},[59,514,515,518,521],{},[77,516,517],{},"Age in completed years",[77,519,520],{},"How many full years have passed?",[77,522,523],{},"17 (as of March 1, 2026)",[59,525,526,529,532],{},[77,527,528],{},"Age at next birthday",[77,530,531],{},"How old will you turn next?",[77,533,140],{},[15,535,536],{},"Life insurance applications and some government forms ask for \"age at next birthday\" rather than completed years. Confusing the two leads to incorrect premium calculations or ineligible claims.",[10,538,540],{"id":539},"key-takeaways","Key Takeaways",[542,543,544,548,551,554,557,560],"ul",{},[545,546,547],"li",{},"Legal age is reached on the birthday, not the day before — a one-day error can cause regulatory violations",[545,549,550],{},"Leap-day births (February 29) reach legal age on February 28 in common years in most jurisdictions",[545,552,553],{},"Year-only subtraction is the most common age calculation bug — always check month and day",[545,555,556],{},"Time zone differences between server and user can shift the birth date by a day",[545,558,559],{},"Different activities have different legal age thresholds — verify the specific requirement for each use case",[545,561,562],{},"\"Age in completed years\" and \"age at next birthday\" are different values — use whichever the form or regulation specifies",[10,564,566],{"id":565},"try-it-yourself","Try It Yourself",[15,568,569,570,575],{},"Calculate exact age in years, months, and days with our ",[571,572,574],"a",{"href":573},"\u002Ftools\u002Fage-calculator","Age Calculator",". Enter a birth date and reference date to see precise results — no manual math required.",[577,578,579],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":35,"searchDepth":395,"depth":395,"links":581},[582,583,586,587,591,596,597,598],{"id":12,"depth":395,"text":13},{"id":20,"depth":395,"text":21,"children":584},[585],{"id":42,"depth":401,"text":43},{"id":100,"depth":395,"text":101},{"id":187,"depth":395,"text":188,"children":588},[589,590],{"id":194,"depth":401,"text":126},{"id":298,"depth":401,"text":299},{"id":369,"depth":395,"text":370,"children":592},[593,594,595],{"id":376,"depth":401,"text":377},{"id":449,"depth":401,"text":450},{"id":478,"depth":401,"text":479},{"id":491,"depth":395,"text":492},{"id":539,"depth":395,"text":540},{"id":565,"depth":395,"text":566},"2026-05-28","When legal age matters — from drinking laws to retirement benefits — exact date arithmetic determines eligibility. Learn the precise rules and edge cases.","md",{"immutable":410},"\u002Fguides\u002Fage-calculation-legal-requirements",{"title":5,"description":600},"guides\u002Fage-calculation-legal-requirements","WkQ2gn4cmh397hCZrLl5fWjBKk6t7XPSy_FxNGAmnsk",1780401331315]