<?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="fmcb-20260812.xsd" xlink:type="simple"/>
    <context id="c20260812to20260812">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001085913</identifier>
        </entity>
        <period>
            <startDate>2026-08-12</startDate>
            <endDate>2026-08-12</endDate>
        </period>
    </context>
    <dei:AmendmentFlag
      contextRef="c20260812to20260812"
      id="Fact_739cdde58b204cddadc30efd9d397d22">false</dei:AmendmentFlag>
    <dei:EntityCentralIndexKey
      contextRef="c20260812to20260812"
      id="Fact_3494ab84987e4707871f944514520407">0001085913</dei:EntityCentralIndexKey>
    <dei:DocumentType
      contextRef="c20260812to20260812"
      id="Fact_ad63c6f6e1e241989080095a9690b58a">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="c20260812to20260812"
      id="Fact_b7a9c2f4f58649f8b84370b8abc0e909">2026-08-12</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="c20260812to20260812"
      id="Fact_632e99b886c64086a1b898723bc3c49d">Farmers &amp; Merchants Bancorp</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="c20260812to20260812"
      id="Fact_639f459f96d348f88ce57f6c51b124c0">DE</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="c20260812to20260812"
      id="Fact_b1452f51060d431dab1b0c12a9001a38">000-26099</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="c20260812to20260812"
      id="Fact_af3b3ba5596a4eacbe8c8b063f9b750f">94-3327828</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="c20260812to20260812"
      id="Fact_5fa36656cd1a4163b794b1c7f1221331">111 West Pine Street</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="c20260812to20260812"
      id="Fact_829d4d02e98248638b069fb5659d44cd">Lodi</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="c20260812to20260812"
      id="Fact_e6005de6273548abab430d82e6db3e98">CA</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="c20260812to20260812"
      id="Fact_4fb41afb981e4a408a1ac7d12581d3ef">95240</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="c20260812to20260812"
      id="Fact_7d36a702ed064887902cfa2898f8815b">209</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="c20260812to20260812"
      id="Fact_80f3748b14b74b36be1778fb22a3f97f">367-2300</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="c20260812to20260812"
      id="Fact_47d741db006543ab903eb22b3386a6bb">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="c20260812to20260812"
      id="Fact_e96062f18d7243eeb2495eed11a6c6b7">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="c20260812to20260812"
      id="Fact_bfb0170489f24cc080e9b80b5d7444d2">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="c20260812to20260812"
      id="Fact_0445106949fe472a854bb5ffd36dc953">false</dei:PreCommencementIssuerTenderOffer>
    <dei:EntityEmergingGrowthCompany
      contextRef="c20260812to20260812"
      id="Fact_0b232c27a0844e07ac0392e40ad9bda6">false</dei:EntityEmergingGrowthCompany>
</xbrl>
