<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.24.1.u1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>479</ContextCount>
  <ElementCount>412</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>90</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>10</UnitCount>
  <MyReports>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>100000 - Document - Document and Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DocumentDocumentAndEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>100010 - Statement - Condensed Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_StatementCondensedConsolidatedBalanceSheets</Role>
      <ShortName>Condensed Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>100020 - Statement - Condensed Consolidated Balance Sheets (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_StatementCondensedConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Condensed Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>100030 - Statement - Condensed Consolidated Statements of Income (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_StatementCondensedConsolidatedStatementsOfIncomeUnaudited</Role>
      <ShortName>Condensed Consolidated Statements of Income (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>100040 - Statement - Condensed Consolidated Statements of Comprehensive Income (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/StatementCondensedConsolidatedStatementsOfComprehensiveIncomeUnaudited</Role>
      <ShortName>Condensed Consolidated Statements of Comprehensive Income (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>100050 - Statement - Condensed Consolidated Statements of Changes to Stockholder's Equity (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_StatementCondensedConsolidatedStatementsOfChangesToStockholderSEquityUnaudited</Role>
      <ShortName>Condensed Consolidated Statements of Changes to Stockholder's Equity (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>100060 - Statement - Condensed Consolidated Statements of Changes to Stockholder's Equity (Parenthetical) (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_StatementCondensedConsolidatedStatementsOfChangesToStockholderSEquityParentheticalUnaudited</Role>
      <ShortName>Condensed Consolidated Statements of Changes to Stockholder's Equity (Parenthetical) (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>100070 - Statement - Condensed Consolidated Statements of Cash Flows (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_StatementCondensedConsolidatedStatementsOfCashFlowsUnaudited</Role>
      <ShortName>Condensed Consolidated Statements of Cash Flows (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>995410 - Disclosure - Pay vs Performance Disclosure</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/PvpDisclosure</Role>
      <ShortName>Pay vs Performance Disclosure</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>995445 - Disclosure - Insider Trading Arrangements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/InsiderTradingArrangements</Role>
      <ShortName>Insider Trading Arrangements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>995455 - Disclosure - Basis of Presentation and Other</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureBasisOfPresentationAndOther</Role>
      <ShortName>Basis of Presentation and Other</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>995465 - Disclosure - Business Combination and Asset Purchase</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchase</Role>
      <ShortName>Business Combination and Asset Purchase</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>995475 - Disclosure - Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSecurities</Role>
      <ShortName>Securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>995485 - Disclosure - Loans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoans</Role>
      <ShortName>Loans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>995495 - Disclosure - Leases</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureLeases</Role>
      <ShortName>Leases</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>995505 - Disclosure - Servicing</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureServicing</Role>
      <ShortName>Servicing</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>995515 - Disclosure - Earnings Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureEarningsPerShare</Role>
      <ShortName>Earnings Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>995525 - Disclosure - Derivative Financial Instruments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureDerivativeFinancialInstruments1</Role>
      <ShortName>Derivative Financial Instruments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>995535 - Disclosure - Qualified Affordable Housing Project Investments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureQualifiedAffordableHousingProjectInvestments</Role>
      <ShortName>Qualified Affordable Housing Project Investments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>995545 - Disclosure - Fair Value of Financial Instruments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFairValueOfFinancialInstruments</Role>
      <ShortName>Fair Value of Financial Instruments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>995555 - Disclosure - Federal Funds Purchased and Securities Sold Under Agreements to Repurchase</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFederalFundsPurchasedAndSecuritiesSoldUnderAgreementsToRepurchase</Role>
      <ShortName>Federal Funds Purchased and Securities Sold Under Agreements to Repurchase</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>995565 - Disclosure - Subordinated Notes</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSubordinatedNotes</Role>
      <ShortName>Subordinated Notes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>995585 - Disclosure - Recent Accounting Pronouncements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureRecentAccountingPronouncements</Role>
      <ShortName>Recent Accounting Pronouncements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>995595 - Disclosure - Recent Accounting Pronouncements (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureRecentAccountingPronouncementsPolicies</Role>
      <ShortName>Recent Accounting Pronouncements (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureRecentAccountingPronouncements</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>995605 - Disclosure - Business Combination and Asset Purchase (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchaseTables</Role>
      <ShortName>Business Combination and Asset Purchase (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchase</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>995615 - Disclosure - Securities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSecuritiesTables</Role>
      <ShortName>Securities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSecurities</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>995625 - Disclosure - Loans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansTables</Role>
      <ShortName>Loans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoans</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>995635 - Disclosure - Leases (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureLeasesTables</Role>
      <ShortName>Leases (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/DisclosureLeases</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>995645 - Disclosure - Servicing (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureServicingTables</Role>
      <ShortName>Servicing (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/DisclosureServicing</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>995655 - Disclosure - Earnings Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureEarningsPerShareTables</Role>
      <ShortName>Earnings Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureEarningsPerShare</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>995665 - Disclosure - Derivative Financial Instruments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureDerivativeFinancialInstrumentsTables</Role>
      <ShortName>Derivative Financial Instruments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/DisclosureDerivativeFinancialInstruments1</ParentRole>
      <Position>31</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>995675 - Disclosure - Fair Value of Financial Instruments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFairValueOfFinancialInstrumentsTables</Role>
      <ShortName>Fair Value of Financial Instruments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFairValueOfFinancialInstruments</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>995685 - Disclosure - Federal Funds Purchased and Securities Sold Under Agreements to Repurchase (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFederalFundsPurchasedAndSecuritiesSoldUnderAgreementsToRepurchaseTables</Role>
      <ShortName>Federal Funds Purchased and Securities Sold Under Agreements to Repurchase (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFederalFundsPurchasedAndSecuritiesSoldUnderAgreementsToRepurchase</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>995695 - Disclosure - Subordinated Notes (Tables)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSubordinatedNotesTables</Role>
      <ShortName>Subordinated Notes (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSubordinatedNotes</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>995715 - Disclosure - Business Combination and Asset Purchase - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchaseAdditionalInformationDetail</Role>
      <ShortName>Business Combination and Asset Purchase - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>995725 - Disclosure - Business Combination and Asset Purchase - Summary of Consideration Paid and Amounts of Assets Acquired and Liabilities Assumed Recognized (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchaseSummaryOfConsiderationPaidAndAmountsOfAssetsAcquiredAndLiabilitiesAssumedRecognizedDetail</Role>
      <ShortName>Business Combination and Asset Purchase - Summary of Consideration Paid and Amounts of Assets Acquired and Liabilities Assumed Recognized (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>995735 - Disclosure - Business Combination and Asset Purchase - Summary of Consideration Paid and Amounts of Assets Acquired and Liabilities Assumed Recognized (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchaseSummaryOfConsiderationPaidAndAmountsOfAssetsAcquiredAndLiabilitiesAssumedRecognizedParentheticalDetail</Role>
      <ShortName>Business Combination and Asset Purchase - Summary of Consideration Paid and Amounts of Assets Acquired and Liabilities Assumed Recognized (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>995775 - Disclosure - Business Combination and Asset Purchase - Summary of Changes in Accretable Yield or Income Expected to be Collected (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchaseSummaryOfChangesInAccretableYieldOrIncomeExpectedToBeCollectedDetail</Role>
      <ShortName>Business Combination and Asset Purchase - Summary of Changes in Accretable Yield or Income Expected to be Collected (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>995795 - Disclosure - Business Combination and Asset Purchase - Schedule of Annual Amortization of Core Deposit Intangible Assets (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchaseScheduleOfAnnualAmortizationOfCoreDepositIntangibleAssetsDetail</Role>
      <ShortName>Business Combination and Asset Purchase - Schedule of Annual Amortization of Core Deposit Intangible Assets (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>995805 - Disclosure - Securities - Amortized Cost and Fair Value of Securities with Gross Unrealized Gains and Losses (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSecuritiesAmortizedCostAndFairValueOfSecuritiesWithGrossUnrealizedGainsAndLossesDetail</Role>
      <ShortName>Securities - Amortized Cost and Fair Value of Securities with Gross Unrealized Gains and Losses (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>995815 - Disclosure - Securities - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSecuritiesAdditionalInformationDetail</Role>
      <ShortName>Securities - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>995825 - Disclosure - Securities - Gross Unrealized Losses, Aggregated by Investment Category and Length of Time (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSecuritiesGrossUnrealizedLossesAggregatedByInvestmentCategoryAndLengthOfTimeDetail</Role>
      <ShortName>Securities - Gross Unrealized Losses, Aggregated by Investment Category and Length of Time (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>995835 - Disclosure - Securities - Gross Realized Gains and Losses (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSecuritiesGrossRealizedGainsAndLossesDetail</Role>
      <ShortName>Securities - Gross Realized Gains and Losses (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>995845 - Disclosure - Securities - Amortized Cost and Fair Value of Debt Securities, by Contractual Maturity (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSecuritiesAmortizedCostAndFairValueOfDebtSecuritiesByContractualMaturityDetail</Role>
      <ShortName>Securities - Amortized Cost and Fair Value of Debt Securities, by Contractual Maturity (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>995855 - Disclosure - Loans - Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansLoansDetail</Role>
      <ShortName>Loans - Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>995865 - Disclosure - Loans - Distribution of Fixed Rate Loans and Variable Rate Loans by Major Loan Category (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansDistributionOfFixedRateLoansAndVariableRateLoansByMajorLoanCategoryDetail</Role>
      <ShortName>Loans - Distribution of Fixed Rate Loans and Variable Rate Loans by Major Loan Category (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>995875 - Disclosure - Loans - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansAdditionalInformationDetail</Role>
      <ShortName>Loans - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>995885 - Disclosure - Loans - Contractual Aging of Recorded Investment in Past Due Loans by Portfolio Classification of Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansContractualAgingOfRecordedInvestmentInPastDueLoansByPortfolioClassificationOfLoansDetail</Role>
      <ShortName>Loans - Contractual Aging of Recorded Investment in Past Due Loans by Portfolio Classification of Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>995895 - Disclosure - Loans - Amortized Cost of Nonaccrual Loans by Portfolio Class of Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureLoansAmortizedCostOfNonaccrualLoansByPortfolioClassOfLoansDetail</Role>
      <ShortName>Loans - Amortized Cost of Nonaccrual Loans by Portfolio Class of Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>995905 - Disclosure - Loans (Tier Risk Rating System) - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansTierRiskRatingSystemAdditionalInformationDetail</Role>
      <ShortName>Loans (Tier Risk Rating System) - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansTables</ParentRole>
      <Position>50</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>995915 - Disclosure - Loans - Risk Category of Loans by Portfolio Class (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansRiskCategoryOfLoansByPortfolioClassDetail</Role>
      <ShortName>Loans - Risk Category of Loans by Portfolio Class (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>995925 - Disclosure - Loans - Recorded Investment for Consumer Loans, Credit Quality based on Status of Loan and Payment Activity (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansRecordedInvestmentForConsumerLoansCreditQualityBasedOnStatusOfLoanAndPaymentActivityDetail</Role>
      <ShortName>Loans - Recorded Investment for Consumer Loans, Credit Quality based on Status of Loan and Payment Activity (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>995935 - Disclosure - Loans - Risk Category of Loans by Portfolio Class Based on Year of Origination (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureLoansRiskCategoryOfLoansByPortfolioClassBasedOnYearOfOriginationDetail</Role>
      <ShortName>Loans - Risk Category of Loans by Portfolio Class Based on Year of Origination (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>995945 - Disclosure - Loans - Schedule of Collateral-dependent Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureLoansScheduleOfCollateraldependentLoansDetail</Role>
      <ShortName>Loans - Schedule of Collateral-dependent Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>995955 - Disclosure - Loans (Impaired Loans) - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansImpairedLoansAdditionalInformationDetail</Role>
      <ShortName>Loans (Impaired Loans) - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansTables</ParentRole>
      <Position>55</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>995965 - Disclosure - Loans - Summary of Activities in Allowance for Credit Losses (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansSummaryOfActivitiesInAllowanceForCreditLossesDetail</Role>
      <ShortName>Loans - Summary of Activities in Allowance for Credit Losses (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>995975 - Disclosure - Loans (CECL) - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureLoansCeclAdditionalInformationDetail</Role>
      <ShortName>Loans (CECL) - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansTables</ParentRole>
      <Position>57</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>995985 - Disclosure - Loans - Analysis of Allowance for Credit Losses (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureLoansAnalysisOfAllowanceForCreditLossesDetail</Role>
      <ShortName>Loans - Analysis of Allowance for Credit Losses (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>995995 - Disclosure - Leases - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureLeasesAdditionalInformationDetails</Role>
      <ShortName>Leases - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>996005 - Disclosure - Leases - Operating Lease Costs and Cash Flows (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureLeasesOperatingLeaseCostsAndCashFlowsDetails</Role>
      <ShortName>Leases - Operating Lease Costs and Cash Flows (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>996015 - Disclosure - Servicing - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureServicingAdditionalInformationDetails</Role>
      <ShortName>Servicing - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>996025 - Disclosure - Servicing - Summary of Mortgage Servicing Rights Capitalized and Amortized (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureServicingSummaryOfMortgageServicingRightsCapitalizedAndAmortizedDetails</Role>
      <ShortName>Servicing - Summary of Mortgage Servicing Rights Capitalized and Amortized (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>996035 - Disclosure - Earnings Per Share - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureEarningsPerShareAdditionalInformationDetail</Role>
      <ShortName>Earnings Per Share - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>996045 - Disclosure - Earnings Per Share - Calculation of Basic Earnings Per Share (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureEarningsPerShareCalculationOfBasicEarningsPerShareDetail</Role>
      <ShortName>Earnings Per Share - Calculation of Basic Earnings Per Share (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>64</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>996055 - Disclosure - Derivative Financial Instruments - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureDerivativeFinancialInstrumentsAdditionalInformationDetails</Role>
      <ShortName>Derivative Financial Instruments - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>65</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>996065 - Disclosure - Derivative Financial Instruments - Schedule of Cumulative Basis Adjustments for Interest Rate Swap Derivatives Designated as Fair Value Accounting Hedges (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureDerivativeFinancialInstrumentsScheduleOfCumulativeBasisAdjustmentsForInterestRateSwapDerivativesDesignatedAsFairValueAccountingHe</Role>
      <ShortName>Derivative Financial Instruments - Schedule of Cumulative Basis Adjustments for Interest Rate Swap Derivatives Designated as Fair Value Accounting Hedges (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>66</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>996075 - Disclosure - Derivative Financial Instruments - Summary of Interest Rate Swap Derivatives Designated as Fair Value Accounting Hedges of Fixed-rate Receivables (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureDerivativeFinancialInstrumentsSummaryOfInterestRateSwapDerivativesDesignatedAsFairValueAccountingHedgesOfFixedrateReceivablesDeta</Role>
      <ShortName>Derivative Financial Instruments - Summary of Interest Rate Swap Derivatives Designated as Fair Value Accounting Hedges of Fixed-rate Receivables (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>67</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>996085 - Disclosure - Derivative Financial Instruments - Schedule of Notional Amount and Fair Value of Interest Rate Swaps (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureDerivativeFinancialInstrumentsScheduleOfNotionalAmountAndFairValueOfInterestRateSwapsDetails</Role>
      <ShortName>Derivative Financial Instruments - Schedule of Notional Amount and Fair Value of Interest Rate Swaps (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>68</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>996095 - Disclosure - Derivative Financial Instruments - Schedule of Effects of Interest Rate Swap Agreements on Consolidated Statements of Income (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureDerivativeFinancialInstrumentsScheduleOfEffectsOfInterestRateSwapAgreementsOnConsolidatedStatementsOfIncomeDetails</Role>
      <ShortName>Derivative Financial Instruments - Schedule of Effects of Interest Rate Swap Agreements on Consolidated Statements of Income (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>69</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>996105 - Disclosure - Qualified Affordable Housing Project Investments - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureQualifiedAffordableHousingProjectInvestmentsAdditionalInformationDetail</Role>
      <ShortName>Qualified Affordable Housing Project Investments - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>70</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R71.htm</HtmlFileName>
      <LongName>996115 - Disclosure - Fair Value of Financial Instruments - Financial Assets Measured at Fair Value on Recurring Basis (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFairValueOfFinancialInstrumentsFinancialAssetsMeasuredAtFairValueOnRecurringBasisDetail</Role>
      <ShortName>Fair Value of Financial Instruments - Financial Assets Measured at Fair Value on Recurring Basis (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>71</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R72.htm</HtmlFileName>
      <LongName>996125 - Disclosure - Fair Value of Financial Instruments - Changes in the Level 3 Fair Value Category of Unobservable Inputs (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFairValueOfFinancialInstrumentsChangesInLevel3FairValueCategoryOfUnobservableInputsDetail</Role>
      <ShortName>Fair Value of Financial Instruments - Changes in the Level 3 Fair Value Category of Unobservable Inputs (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>72</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R73.htm</HtmlFileName>
      <LongName>996135 - Disclosure - Fair Value of Financial Instruments - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFairValueOfFinancialInstrumentsAdditionalInformationDetail</Role>
      <ShortName>Fair Value of Financial Instruments - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>73</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R74.htm</HtmlFileName>
      <LongName>996145 - Disclosure - Fair Value of Financial Instruments - Assets Measured at Fair Value on Nonrecurring Basis (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFairValueOfFinancialInstrumentsAssetsMeasuredAtFairValueOnNonrecurringBasisDetail</Role>
      <ShortName>Fair Value of Financial Instruments - Assets Measured at Fair Value on Nonrecurring Basis (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>74</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R75.htm</HtmlFileName>
      <LongName>996155 - Disclosure - Fair Value of Financial Instruments - Quantitative Information about Unobservable Inputs Used in Recurring and Nonrecurring Level 3 Fair Value Measurements (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFairValueOfFinancialInstrumentsQuantitativeInformationAboutUnobservableInputsUsedInRecurringAndNonrecurringLevel3FairValueMeasurementsDetail</Role>
      <ShortName>Fair Value of Financial Instruments - Quantitative Information about Unobservable Inputs Used in Recurring and Nonrecurring Level 3 Fair Value Measurements (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>75</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R76.htm</HtmlFileName>
      <LongName>996165 - Disclosure - Fair Value of Financial Instruments - Estimated Fair Values and Related Carrying or Notional Amounts (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFairValueOfFinancialInstrumentsEstimatedFairValuesAndRelatedCarryingOrNotionalAmountsDetail</Role>
      <ShortName>Fair Value of Financial Instruments - Estimated Fair Values and Related Carrying or Notional Amounts (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>76</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R77.htm</HtmlFileName>
      <LongName>996175 - Disclosure - Federal Funds Purchased and Securities Sold Under Agreements to Repurchase - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFederalFundsPurchasedAndSecuritiesSoldUnderAgreementsToRepurchaseAdditionalInformationDetail</Role>
      <ShortName>Federal Funds Purchased and Securities Sold Under Agreements to Repurchase - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>77</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R78.htm</HtmlFileName>
      <LongName>996185 - Disclosure - Federal Funds Purchased and Securities Sold Under Agreements to Repurchase - Schedule of Remaining Contractual Maturity in Repurchase Agreements (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureFederalFundsPurchasedAndSecuritiesSoldUnderAgreementsToRepurchaseScheduleOfRemainingContractualMaturityInRepurchaseAgreementsDetail</Role>
      <ShortName>Federal Funds Purchased and Securities Sold Under Agreements to Repurchase - Schedule of Remaining Contractual Maturity in Repurchase Agreements (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>78</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R79.htm</HtmlFileName>
      <LongName>996195 - Disclosure - Subordinated Notes - Additional Information (Detail)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSubordinatedNotesAdditionalInformationDetail</Role>
      <ShortName>Subordinated Notes - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>79</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R80.htm</HtmlFileName>
      <LongName>996205 - Disclosure - Subordinated Notes - Schedule of Subordinated Notes (Detail)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/Role_DisclosureSubordinatedNotesScheduleOfSubordinatedNotesDetail</Role>
      <ShortName>Subordinated Notes - Schedule of Subordinated Notes (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>80</Position>
    </Report>
    <Report instance="fmao-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R81.htm</HtmlFileName>
      <LongName>996225 - Disclosure - Recent Accounting Pronouncements - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20240331/taxonomy/role/DisclosureRecentAccountingPronouncementsAdditionalInformationDetails</Role>
      <ShortName>Recent Accounting Pronouncements - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>81</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <Logs>
    <Log type="Warning">[ix-0514-Hidden-Fact-Eligible-For-Transform] WARN: 1 fact(s) appearing in ix:hidden were eligible for transformation: fmao:RepaymentPeriodOfLoanWithReasonableReductionOfPrincipalBalance -  fmao-20240331.htm 8</Log>
  </Logs>
  <InputFiles>
    <File doctype="10-Q" isDefinitelyFs="true" isUsgaap="true" original="fmao-20240331.htm">fmao-20240331.htm</File>
    <File>fmao-20240331.xsd</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="1364">http://fasb.org/us-gaap/2023</BaseTaxonomy>
    <BaseTaxonomy items="29">http://xbrl.sec.gov/dei/2023</BaseTaxonomy>
    <BaseTaxonomy items="4">http://xbrl.sec.gov/ecd/2023</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>false</HasPresentationLinkbase>
  <HasCalculationLinkbase>false</HasCalculationLinkbase>
</FilingSummary>
