<?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="mbbc-20251118.xsd" xlink:type="simple"/>
    <context id="c20251118to20251118">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001835385</identifier>
        </entity>
        <period>
            <startDate>2025-11-18</startDate>
            <endDate>2025-11-18</endDate>
        </period>
    </context>
    <dei:AmendmentFlag
      contextRef="c20251118to20251118"
      id="Fact_e577722566a4439aa6529c3f05ae8af1">false</dei:AmendmentFlag>
    <dei:EntityFileNumber
      contextRef="c20251118to20251118"
      id="Fact_1bce43e48a9740e4a96232abb12e0aa5">000-56269</dei:EntityFileNumber>
    <dei:EntityCentralIndexKey
      contextRef="c20251118to20251118"
      id="Fact_dcdee32c44aa4893b4b329b76ae6c022">0001835385</dei:EntityCentralIndexKey>
    <dei:SecurityExchangeName
      contextRef="c20251118to20251118"
      id="Fact_95b0480932f046a5af2961b649888786">NASDAQ</dei:SecurityExchangeName>
    <dei:DocumentType
      contextRef="c20251118to20251118"
      id="Fact_a1f43c9e68344313a382fa79ba7fd96b">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="c20251118to20251118"
      id="Fact_54723ead2aec42ce8c7fd1c71df12d57">2025-11-18</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="c20251118to20251118"
      id="Fact_ebc156b863744861ba43e683b66033af">MARATHON BANCORP, INC.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="c20251118to20251118"
      id="Fact_b78496bac4a14cf1981c4a27a90165fa">MD</dei:EntityIncorporationStateCountryCode>
    <dei:EntityTaxIdentificationNumber
      contextRef="c20251118to20251118"
      id="Fact_0b0bf14e01a0474a87e58a9cb370aae3">86-2191258</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="c20251118to20251118"
      id="Fact_d792db1acf8d48fd96bdfe10df4b5a49">500 Scott Street</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="c20251118to20251118"
      id="Fact_8a61900b93b346068e54e1a98da2fd7d">Wausau</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="c20251118to20251118"
      id="Fact_62fde2d4ca2f4bb7bd8175a755d04c79">WI</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="c20251118to20251118"
      id="Fact_59d492d73de849e48ee923f7cad943bf">54402</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="c20251118to20251118"
      id="Fact_7abdf6e2a7c94500a5cca9cb19a2a6c9">715</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="c20251118to20251118"
      id="Fact_d32a704bba3041a1962fc4b8a660e320">845-7331</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="c20251118to20251118"
      id="Fact_e5fbc8524d2543ea9b0ab264e7e3bbc7">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="c20251118to20251118"
      id="Fact_a72dfe9462b64dab8785158eb4f0ecf9">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="c20251118to20251118"
      id="Fact_22cdd47ce9f6439c97ddf6c26149590c">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="c20251118to20251118"
      id="Fact_0f3cc0adc14a42e5a809c4b7915e7dca">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="c20251118to20251118"
      id="Fact_b3ae233eb5e54310977815c22c26ccef">Common Stock, $0.01 par value</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="c20251118to20251118"
      id="Fact_668273402495483aa9d4d5a245265902">MBBC</dei:TradingSymbol>
    <dei:EntityEmergingGrowthCompany
      contextRef="c20251118to20251118"
      id="Fact_1caceb5a3e5842079d1a07069c1b5ac2">true</dei:EntityEmergingGrowthCompany>
    <dei:EntityExTransitionPeriod
      contextRef="c20251118to20251118"
      id="Fact_0a5441db9b7742c79e36408034134cdf">false</dei:EntityExTransitionPeriod>
</xbrl>
