<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2026"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="fmfg-20260921.xsd" xlink:type="simple"/>
    <context id="d20268K">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001698022</identifier>
        </entity>
        <period>
            <startDate>2026-09-21</startDate>
            <endDate>2026-09-21</endDate>
        </period>
    </context>
    <dei:AmendmentFlag contextRef="d20268K" id="ixv-261">false</dei:AmendmentFlag>
    <dei:EntityCentralIndexKey contextRef="d20268K" id="ixv-262">0001698022</dei:EntityCentralIndexKey>
    <dei:DocumentType contextRef="d20268K" id="ixv-272">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate contextRef="d20268K" id="ixv-273">2026-09-21</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName contextRef="d20268K" id="ixv-29">Farmers and Merchants Bancshares, Inc.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode contextRef="d20268K" id="ixv-39">MD</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber contextRef="d20268K" id="ixv-43">000-55756</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber contextRef="d20268K" id="ixv-47">81-3605835</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1 contextRef="d20268K" id="ixv-65">4510 Lower Beckleysville Road, Suite H</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown contextRef="d20268K" id="ixv-68">Hampstead</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince contextRef="d20268K" id="ixv-71">MD</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode contextRef="d20268K" id="ixv-75">21074</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode contextRef="d20268K" id="ixv-85">410</dei:CityAreaCode>
    <dei:LocalPhoneNumber contextRef="d20268K" id="ixv-88">374-1510</dei:LocalPhoneNumber>
    <dei:WrittenCommunications contextRef="d20268K" id="ixv-274">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial contextRef="d20268K" id="ixv-275">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer contextRef="d20268K" id="ixv-276">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer contextRef="d20268K" id="ixv-277">false</dei:PreCommencementIssuerTenderOffer>
    <dei:EntityEmergingGrowthCompany contextRef="d20268K" id="ixv-278">false</dei:EntityEmergingGrowthCompany>
</xbrl>
