<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2025"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="fmbm-20261104.xsd" xlink:type="simple"/>
    <context id="From2026-11-04to2026-11-04">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000740806</identifier>
        </entity>
        <period>
            <startDate>2026-11-04</startDate>
            <endDate>2026-11-04</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey contextRef="From2026-11-04to2026-11-04" id="ixv-292">0000740806</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag contextRef="From2026-11-04to2026-11-04" id="ixv-293">false</dei:AmendmentFlag>
    <dei:DocumentType contextRef="From2026-11-04to2026-11-04" id="ixv-313">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate contextRef="From2026-11-04to2026-11-04" id="ixv-314">2026-11-04</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName contextRef="From2026-11-04to2026-11-04" id="ixv-315">F&amp;M Bank Corp.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode contextRef="From2026-11-04to2026-11-04" id="ixv-316">VA</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber contextRef="From2026-11-04to2026-11-04" id="ixv-317">000-13273</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber contextRef="From2026-11-04to2026-11-04" id="ixv-318">54-1280811</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1 contextRef="From2026-11-04to2026-11-04" id="ixv-319">P.O. Box 1111</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown contextRef="From2026-11-04to2026-11-04" id="ixv-320">Timberville</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince contextRef="From2026-11-04to2026-11-04" id="ixv-321">VA</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode contextRef="From2026-11-04to2026-11-04" id="ixv-322">22853</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode contextRef="From2026-11-04to2026-11-04" id="ixv-323">540</dei:CityAreaCode>
    <dei:LocalPhoneNumber contextRef="From2026-11-04to2026-11-04" id="ixv-324">896-8941</dei:LocalPhoneNumber>
    <dei:WrittenCommunications contextRef="From2026-11-04to2026-11-04" id="ixv-325">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial contextRef="From2026-11-04to2026-11-04" id="ixv-326">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer contextRef="From2026-11-04to2026-11-04" id="ixv-327">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer contextRef="From2026-11-04to2026-11-04" id="ixv-328">false</dei:PreCommencementIssuerTenderOffer>
    <dei:EntityEmergingGrowthCompany contextRef="From2026-11-04to2026-11-04" id="ixv-329">false</dei:EntityEmergingGrowthCompany>
</xbrl>
