<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2024"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="fmfg-20260518.xsd" xlink:type="simple"/>
    <context id="d20268K">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001698022</identifier>
        </entity>
        <period>
            <startDate>2026-05-18</startDate>
            <endDate>2026-05-18</endDate>
        </period>
    </context>
    <dei:AmendmentFlag contextRef="d20268K" id="ixv-487">false</dei:AmendmentFlag>
    <dei:EntityCentralIndexKey contextRef="d20268K" id="ixv-488">0001698022</dei:EntityCentralIndexKey>
    <dei:DocumentType contextRef="d20268K" id="ixv-498">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate contextRef="d20268K" id="ixv-499">2026-05-18</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName contextRef="d20268K" id="ixv-500">Farmers and Merchants Bancshares, Inc.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode contextRef="d20268K" id="ixv-501">MD</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber contextRef="d20268K" id="ixv-502">000-55756</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber contextRef="d20268K" id="ixv-503">81-3605835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1 contextRef="d20268K" id="ixv-504">4510 Lower Beckleysville Road, Suite H</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown contextRef="d20268K" id="ixv-505">Hampstead</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince contextRef="d20268K" id="ixv-506">MD</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode contextRef="d20268K" id="ixv-507">21074</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode contextRef="d20268K" id="ixv-508">410</dei:CityAreaCode>
    <dei:LocalPhoneNumber contextRef="d20268K" id="ixv-509">374-1510</dei:LocalPhoneNumber>
    <dei:WrittenCommunications contextRef="d20268K" id="ixv-510">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial contextRef="d20268K" id="ixv-511">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer contextRef="d20268K" id="ixv-512">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer contextRef="d20268K" id="ixv-513">false</dei:PreCommencementIssuerTenderOffer>
    <dei:EntityEmergingGrowthCompany contextRef="d20268K" id="ixv-514">false</dei:EntityEmergingGrowthCompany>
</xbrl>
