<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.23.3</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>574</ContextCount>
  <ElementCount>415</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>91</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>9</UnitCount>
  <MyReports>
    <Report instance="fmao-20230930.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/20230930/taxonomy/role/Role_DocumentDocumentAndEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="fmao-20230930.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/20230930/taxonomy/role/Role_StatementCondensedConsolidatedBalanceSheets</Role>
      <ShortName>Condensed Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="fmao-20230930.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/20230930/taxonomy/role/Role_StatementCondensedConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Condensed Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="fmao-20230930.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/20230930/taxonomy/role/Role_StatementCondensedConsolidatedStatementsOfIncomeUnaudited</Role>
      <ShortName>Condensed Consolidated Statements of Income (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>100040 - Statement - Condensed Consolidated Statements of Comprehensive Income (Loss) (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_StatementCondensedConsolidatedStatementsOfComprehensiveIncomeLossUnaudited</Role>
      <ShortName>Condensed Consolidated Statements of Comprehensive Income (Loss) (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="fmao-20230930.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/20230930/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-20230930.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/20230930/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-20230930.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/20230930/taxonomy/role/Role_StatementCondensedConsolidatedStatementsOfCashFlowsUnaudited</Role>
      <ShortName>Condensed Consolidated Statements of Cash Flows (Unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>100090 - Disclosure - Basis of Presentation and Other</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureBasisOfPresentationAndOther</Role>
      <ShortName>Basis of Presentation and Other</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>100100 - Disclosure - Business Combination and Asset Purchase</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchase</Role>
      <ShortName>Business Combination and Asset Purchase</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>100110 - Disclosure - Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSecurities</Role>
      <ShortName>Securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>100120 - Disclosure - Loans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoans</Role>
      <ShortName>Loans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>100130 - Disclosure - Earnings Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureEarningsPerShare</Role>
      <ShortName>Earnings Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>100140 - Disclosure - Fair Value of Financial Instruments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureFairValueOfFinancialInstruments</Role>
      <ShortName>Fair Value of Financial Instruments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>100150 - Disclosure - Federal Funds Purchased and Securities Sold Under Agreements to Repurchase</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureFederalFundsPurchasedAndSecuritiesSoldUnderAgreementsToRepurchase</Role>
      <ShortName>Federal Funds Purchased and Securities Sold Under Agreements to Repurchase</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>100160 - Disclosure - Subordinated Notes</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSubordinatedNotes</Role>
      <ShortName>Subordinated Notes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>100180 - Disclosure - Recent Accounting Pronouncements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureRecentAccountingPronouncements</Role>
      <ShortName>Recent Accounting Pronouncements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>100190 - Disclosure - Recent Accounting Pronouncements (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureRecentAccountingPronouncementsPolicies</Role>
      <ShortName>Recent Accounting Pronouncements (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureRecentAccountingPronouncements</ParentRole>
      <Position>18</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>100200 - Disclosure - Business Combination and Asset Purchase (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchaseTables</Role>
      <ShortName>Business Combination and Asset Purchase (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchase</ParentRole>
      <Position>19</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>100210 - Disclosure - Securities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSecuritiesTables</Role>
      <ShortName>Securities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSecurities</ParentRole>
      <Position>20</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>100220 - Disclosure - Loans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansTables</Role>
      <ShortName>Loans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoans</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>100230 - Disclosure - Earnings Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureEarningsPerShareTables</Role>
      <ShortName>Earnings Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureEarningsPerShare</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>100240 - Disclosure - Fair Value of Financial Instruments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureFairValueOfFinancialInstrumentsTables</Role>
      <ShortName>Fair Value of Financial Instruments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureFairValueOfFinancialInstruments</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>100250 - Disclosure - Federal Funds Purchased and Securities Sold Under Agreements to Repurchase (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/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/20230930/taxonomy/role/Role_DisclosureFederalFundsPurchasedAndSecuritiesSoldUnderAgreementsToRepurchase</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>100260 - Disclosure - Subordinated Notes (Tables)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSubordinatedNotesTables</Role>
      <ShortName>Subordinated Notes (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSubordinatedNotes</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>100270 - Disclosure - Recent Accounting Pronouncements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/DisclosureRecentAccountingPronouncementsTables</Role>
      <ShortName>Recent Accounting Pronouncements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureRecentAccountingPronouncements</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>100280 - Disclosure - Business Combination and Asset Purchase - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchaseAdditionalInformationDetail</Role>
      <ShortName>Business Combination and Asset Purchase - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>27</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>100290 - 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/20230930/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>28</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>100300 - 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/20230930/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>29</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>100340 - 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/20230930/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>30</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>100350 - Disclosure - Business Combination and Asset Purchase - Schedule of Pro-forma Results (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureBusinessCombinationAndAssetPurchaseScheduleOfProFormaResultsDetail</Role>
      <ShortName>Business Combination and Asset Purchase - Schedule of Pro-forma Results (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>100360 - 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/20230930/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>32</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>100370 - 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/20230930/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>33</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>100380 - Disclosure - Securities - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSecuritiesAdditionalInformationDetail</Role>
      <ShortName>Securities - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>100390 - Disclosure - Securities - Gross Unrealized Losses, Aggregated by Investment Category and Length of Time (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSecuritiesGrossUnrealizedLossesAggregatedByInvestmentCategoryAndLengthOfTimeDetail</Role>
      <ShortName>Securities - Gross Unrealized Losses, Aggregated by Investment Category and Length of Time (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>100400 - Disclosure - Securities - Gross Realized Gains and Losses (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSecuritiesGrossRealizedGainsAndLossesDetail</Role>
      <ShortName>Securities - Gross Realized Gains and Losses (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>100410 - Disclosure - Securities - Amortized Cost and Fair Value of Debt Securities, by Contractual Maturity (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSecuritiesAmortizedCostAndFairValueOfDebtSecuritiesByContractualMaturityDetail</Role>
      <ShortName>Securities - Amortized Cost and Fair Value of Debt Securities, by Contractual Maturity (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>100420 - Disclosure - Loans - Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansLoansDetail</Role>
      <ShortName>Loans - Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>100430 - 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/20230930/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>39</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>100440 - Disclosure - Loans - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansAdditionalInformationDetail</Role>
      <ShortName>Loans - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>100450 - 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/20230930/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>41</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>100460 - Disclosure - Loans - Amortized Cost of Nonaccrual Loans by Portfolio Class of Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/DisclosureLoansAmortizedCostOfNonaccrualLoansByPortfolioClassOfLoansDetail</Role>
      <ShortName>Loans - Amortized Cost of Nonaccrual Loans by Portfolio Class of Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>100470 - Disclosure - Loans (Tier Risk Rating System) - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansTierRiskRatingSystemAdditionalInformationDetail</Role>
      <ShortName>Loans (Tier Risk Rating System) - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansTables</ParentRole>
      <Position>43</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>100480 - Disclosure - Loans - Risk Category of Loans by Portfolio Class (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansRiskCategoryOfLoansByPortfolioClassDetail</Role>
      <ShortName>Loans - Risk Category of Loans by Portfolio Class (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>100490 - 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/20230930/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>45</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>100500 - Disclosure - Loans - Loan Balances Based on Year of Origination (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/DisclosureLoansLoanBalancesBasedOnYearOfOriginationDetails</Role>
      <ShortName>Loans - Loan Balances Based on Year of Origination (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>100510 - Disclosure - Loans - Schedule of Collateral-dependent Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/DisclosureLoansScheduleOfCollateraldependentLoansDetail</Role>
      <ShortName>Loans - Schedule of Collateral-dependent Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>100520 - Disclosure - Loans - Schedule of Impaired Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansScheduleOfImpairedLoansDetail</Role>
      <ShortName>Loans - Schedule of Impaired Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>100530 - Disclosure - Loans (Impaired Loans) - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansImpairedLoansAdditionalInformationDetail</Role>
      <ShortName>Loans (Impaired Loans) - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansTables</ParentRole>
      <Position>49</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>100550 - Disclosure - Loans - Loans Individually Evaluated for Impairment by Portfolio Class of Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansLoansIndividuallyEvaluatedForImpairmentByPortfolioClassOfLoansDetail</Role>
      <ShortName>Loans - Loans Individually Evaluated for Impairment by Portfolio Class of Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>100560 - Disclosure - Loans - Summary of Activities in Allowance for Credit Losses (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansSummaryOfActivitiesInAllowanceForCreditLossesDetail</Role>
      <ShortName>Loans - Summary of Activities in Allowance for Credit Losses (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>100570 - Disclosure - Loans (CECL) - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/DisclosureLoansCeclAdditionalInformationDetail</Role>
      <ShortName>Loans (CECL) - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansTables</ParentRole>
      <Position>52</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>100580 - Disclosure - Loans - Analysis of Allowance for Credit Losses (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureLoansAnalysisOfAllowanceForCreditLossesDetail</Role>
      <ShortName>Loans - Analysis of Allowance for Credit Losses (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>100590 - Disclosure - Earnings Per Share - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureEarningsPerShareAdditionalInformationDetail</Role>
      <ShortName>Earnings Per Share - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>100600 - Disclosure - Earnings Per Share - Calculation of Basic Earnings Per Share (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureEarningsPerShareCalculationOfBasicEarningsPerShareDetail</Role>
      <ShortName>Earnings Per Share - Calculation of Basic Earnings Per Share (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>100610 - 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/20230930/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>56</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>100620 - 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/20230930/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>57</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>100630 - Disclosure - Fair Value of Financial Instruments - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureFairValueOfFinancialInstrumentsAdditionalInformationDetail</Role>
      <ShortName>Fair Value of Financial Instruments - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>100640 - 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/20230930/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>59</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>100650 - Disclosure - Fair Value of Financial Instruments - Assets Measured at Fair Value on Nonrecurring Basis (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/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>60</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>100660 - 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/20230930/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>61</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>100670 - Disclosure - Federal Funds Purchased and Securities Sold Under Agreements to Repurchase - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureFederalFundsPurchasedAndSecuritiesSoldUnderAgreementsToRepurchaseAdditionalInformationDetail</Role>
      <ShortName>Federal Funds Purchased and Securities Sold Under Agreements to Repurchase - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>100680 - 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/20230930/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>63</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>100690 - Disclosure - Subordinated Notes - Additional Information (Detail)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSubordinatedNotesAdditionalInformationDetail</Role>
      <ShortName>Subordinated Notes - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>64</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>100700 - Disclosure - Subordinated Notes - Schedule of Subordinated Notes (Detail)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/Role_DisclosureSubordinatedNotesScheduleOfSubordinatedNotesDetail</Role>
      <ShortName>Subordinated Notes - Schedule of Subordinated Notes (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>65</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>100720 - Disclosure - Recent Accounting Pronouncements - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/DisclosureRecentAccountingPronouncementsAdditionalInformationDetails</Role>
      <ShortName>Recent Accounting Pronouncements - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>66</Position>
    </Report>
    <Report instance="fmao-20230930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>100730 - Disclosure - Recent Accounting Pronouncements - Schedule of Impact of Adopting ASU (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fm.bank/20230930/taxonomy/role/DisclosureRecentAccountingPronouncementsScheduleOfImpactOfAdoptingAsuDetails</Role>
      <ShortName>Recent Accounting Pronouncements - Schedule of Impact of Adopting ASU (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>67</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File doctype="10-Q" isDefinitelyFs="true" isUsgaap="true" original="fmao-20230930.htm">fmao-20230930.htm</File>
    <File>fmao-20230930.xsd</File>
    <File>fmao-20230930_cal.xml</File>
    <File>fmao-20230930_def.xml</File>
    <File>fmao-20230930_lab.xml</File>
    <File>fmao-20230930_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="1872">http://fasb.org/us-gaap/2023</BaseTaxonomy>
    <BaseTaxonomy items="29">http://xbrl.sec.gov/dei/2023</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
