<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.24.1.u1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>784</ContextCount>
  <ElementCount>418</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>135</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>7</UnitCount>
  <MyReports>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0000001 - Document - COVER PAGE</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/COVERPAGE</Role>
      <ShortName>COVER PAGE</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>0000002 - Statement - CONSOLIDATED BALANCE SHEETS (unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/CONSOLIDATEDBALANCESHEETSunaudited</Role>
      <ShortName>CONSOLIDATED BALANCE SHEETS (unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>0000003 - Statement - CONSOLIDATED BALANCE SHEETS (unaudited) (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/CONSOLIDATEDBALANCESHEETSunauditedParenthetical</Role>
      <ShortName>CONSOLIDATED BALANCE SHEETS (unaudited) (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>0000004 - Statement - CONSOLIDATED STATEMENTS OF OPERATIONS (unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/CONSOLIDATEDSTATEMENTSOFOPERATIONSunaudited</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF OPERATIONS (unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>0000005 - Statement - CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME (unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/CONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOMEunaudited</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME (unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>0000006 - Statement - CONSOLIDATED STATEMENTS OF EQUITY (unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/CONSOLIDATEDSTATEMENTSOFEQUITYunaudited</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF EQUITY (unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>0000007 - Statement - CONSOLIDATED STATEMENTS OF EQUITY (unaudited) (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/CONSOLIDATEDSTATEMENTSOFEQUITYunauditedParenthetical</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF EQUITY (unaudited) (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>0000008 - Statement - CONSOLIDATED STATEMENTS OF CASH FLOWS (unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/CONSOLIDATEDSTATEMENTSOFCASHFLOWSunaudited</Role>
      <ShortName>CONSOLIDATED STATEMENTS OF CASH FLOWS (unaudited)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>0000009 - Disclosure - SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/SUMMARYOFSIGNIFICANTACCOUNTINGPOLICIES</Role>
      <ShortName>SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>0000010 - Disclosure - INVESTMENT SECURITIES</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/INVESTMENTSECURITIES</Role>
      <ShortName>INVESTMENT SECURITIES</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>0000011 - Disclosure - FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FARMERMACGUARANTEEDSECURITIESANDUSDASECURITIES</Role>
      <ShortName>FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>0000012 - Disclosure - FINANCIAL DERIVATIVES</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FINANCIALDERIVATIVES</Role>
      <ShortName>FINANCIAL DERIVATIVES</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>0000013 - Disclosure - LOANS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/LOANS</Role>
      <ShortName>LOANS</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>0000014 - Disclosure - GUARANTEES AND COMMITMENTS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTS</Role>
      <ShortName>GUARANTEES AND COMMITMENTS</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>0000015 - Disclosure - NOTES PAYABLE</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.farmermac.com/role/NOTESPAYABLE</Role>
      <ShortName>NOTES PAYABLE</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>0000016 - Disclosure - EQUITY</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/EQUITY</Role>
      <ShortName>EQUITY</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>0000017 - Disclosure - FAIR VALUE DISCLOSURES</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FAIRVALUEDISCLOSURES</Role>
      <ShortName>FAIR VALUE DISCLOSURES</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>0000018 - Disclosure - BUSINESS SEGMENT REPORTING</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/BUSINESSSEGMENTREPORTING</Role>
      <ShortName>BUSINESS SEGMENT REPORTING</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>995410 - Disclosure - Pay vs Performance Disclosure</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/PvpDisclosure</Role>
      <ShortName>Pay vs Performance Disclosure</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>995445 - Disclosure - Insider Trading Arrangements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/InsiderTradingArrangements</Role>
      <ShortName>Insider Trading Arrangements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>9954471 - Disclosure - SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/SUMMARYOFSIGNIFICANTACCOUNTINGPOLICIESPolicies</Role>
      <ShortName>SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>9954472 - Disclosure - SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/SUMMARYOFSIGNIFICANTACCOUNTINGPOLICIESTables</Role>
      <ShortName>SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/SUMMARYOFSIGNIFICANTACCOUNTINGPOLICIES</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>9954473 - Disclosure - INVESTMENT SECURITIES (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/INVESTMENTSECURITIESTables</Role>
      <ShortName>INVESTMENT SECURITIES (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/INVESTMENTSECURITIES</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>9954474 - Disclosure - FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FARMERMACGUARANTEEDSECURITIESANDUSDASECURITIESTables</Role>
      <ShortName>FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/FARMERMACGUARANTEEDSECURITIESANDUSDASECURITIES</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>9954475 - Disclosure - FINANCIAL DERIVATIVES (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FINANCIALDERIVATIVESTables</Role>
      <ShortName>FINANCIAL DERIVATIVES (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/FINANCIALDERIVATIVES</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>9954476 - Disclosure - LOANS (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/LOANSTables</Role>
      <ShortName>LOANS (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/LOANS</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>9954477 - Disclosure - GUARANTEES AND COMMITMENTS (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTSTables</Role>
      <ShortName>GUARANTEES AND COMMITMENTS (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTS</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>9954478 - Disclosure - NOTES PAYABLE (Tables)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.farmermac.com/role/NOTESPAYABLETables</Role>
      <ShortName>NOTES PAYABLE (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/NOTESPAYABLE</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>9954479 - Disclosure - FAIR VALUE DISCLOSURES (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FAIRVALUEDISCLOSURESTables</Role>
      <ShortName>FAIR VALUE DISCLOSURES (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/FAIRVALUEDISCLOSURES</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>9954480 - Disclosure - BUSINESS SEGMENT REPORTING (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/BUSINESSSEGMENTREPORTINGTables</Role>
      <ShortName>BUSINESS SEGMENT REPORTING (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/BUSINESSSEGMENTREPORTING</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>9954481 - Disclosure - SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/SUMMARYOFSIGNIFICANTACCOUNTINGPOLICIESNarrativeDetails</Role>
      <ShortName>SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>9954482 - Disclosure - SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES - Consolidation of Variable Interest Entities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/SUMMARYOFSIGNIFICANTACCOUNTINGPOLICIESConsolidationofVariableInterestEntitiesDetails</Role>
      <ShortName>SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES - Consolidation of Variable Interest Entities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>9954483 - Disclosure - SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES - Earnings Per Common Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/SUMMARYOFSIGNIFICANTACCOUNTINGPOLICIESEarningsPerCommonShareDetails</Role>
      <ShortName>SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES - Earnings Per Common Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>9954484 - Disclosure - SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES - Schedule of Accumulated Other Comprehensive Income, Net of Tax (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/SUMMARYOFSIGNIFICANTACCOUNTINGPOLICIESScheduleofAccumulatedOtherComprehensiveIncomeNetofTaxDetails</Role>
      <ShortName>SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES - Schedule of Accumulated Other Comprehensive Income, Net of Tax (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>9954485 - Disclosure - SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES - Schedule of Reclassification out of Accumulated Other Comprehensive Income (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/SUMMARYOFSIGNIFICANTACCOUNTINGPOLICIESScheduleofReclassificationoutofAccumulatedOtherComprehensiveIncomeDetails</Role>
      <ShortName>SUMMARY OF SIGNIFICANT ACCOUNTING POLICIES - Schedule of Reclassification out of Accumulated Other Comprehensive Income (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>9954486 - Disclosure - INVESTMENT SECURITIES - Schedule of Investment Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/INVESTMENTSECURITIESScheduleofInvestmentSecuritiesDetails</Role>
      <ShortName>INVESTMENT SECURITIES - Schedule of Investment Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>9954487 - Disclosure - INVESTMENT SECURITIES - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/INVESTMENTSECURITIESNarrativeDetails</Role>
      <ShortName>INVESTMENT SECURITIES - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>9954488 - Disclosure - INVESTMENT SECURITIES - Unrealized Loss Position (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/INVESTMENTSECURITIESUnrealizedLossPositionDetails</Role>
      <ShortName>INVESTMENT SECURITIES - Unrealized Loss Position (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>9954489 - Disclosure - INVESTMENT SECURITIES - Debt Maturities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/INVESTMENTSECURITIESDebtMaturitiesDetails</Role>
      <ShortName>INVESTMENT SECURITIES - Debt Maturities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>9954490 - Disclosure - FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES - Schedule of On-Balance Sheet Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FARMERMACGUARANTEEDSECURITIESANDUSDASECURITIESScheduleofOnBalanceSheetSecuritiesDetails</Role>
      <ShortName>FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES - Schedule of On-Balance Sheet Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>9954491 - Disclosure - FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FARMERMACGUARANTEEDSECURITIESANDUSDASECURITIESNarrativeDetails</Role>
      <ShortName>FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/FARMERMACGUARANTEEDSECURITIESANDUSDASECURITIESTables</ParentRole>
      <Position>41</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>9954492 - Disclosure - FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES - Unrealized Loss Position (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FARMERMACGUARANTEEDSECURITIESANDUSDASECURITIESUnrealizedLossPositionDetails</Role>
      <ShortName>FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES - Unrealized Loss Position (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>9954493 - Disclosure - FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES - Schedule of Available-for-Sale Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FARMERMACGUARANTEEDSECURITIESANDUSDASECURITIESScheduleofAvailableforSaleSecuritiesDetails</Role>
      <ShortName>FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES - Schedule of Available-for-Sale Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>9954494 - Disclosure - FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES - Schedule of Held-to-Maturity Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FARMERMACGUARANTEEDSECURITIESANDUSDASECURITIESScheduleofHeldtoMaturitySecuritiesDetails</Role>
      <ShortName>FARMER MAC GUARANTEED SECURITIES AND USDA SECURITIES - Schedule of Held-to-Maturity Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>9954495 - Disclosure - FINANCIAL DERIVATIVES - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FINANCIALDERIVATIVESNarrativeDetails</Role>
      <ShortName>FINANCIAL DERIVATIVES - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>9954496 - Disclosure - FINANCIAL DERIVATIVES - Schedule of Derivative Instruments in Statement of Financial Position (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FINANCIALDERIVATIVESScheduleofDerivativeInstrumentsinStatementofFinancialPositionDetails</Role>
      <ShortName>FINANCIAL DERIVATIVES - Schedule of Derivative Instruments in Statement of Financial Position (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>9954497 - Disclosure - FINANCIAL DERIVATIVES - Schedule of Net Income/(Expense) Recognized (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FINANCIALDERIVATIVESScheduleofNetIncomeExpenseRecognizedDetails</Role>
      <ShortName>FINANCIAL DERIVATIVES - Schedule of Net Income/(Expense) Recognized (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>9954498 - Disclosure - FINANCIAL DERIVATIVES - Hedged Items in Fair Value Hedging Relationships (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FINANCIALDERIVATIVESHedgedItemsinFairValueHedgingRelationshipsDetails</Role>
      <ShortName>FINANCIAL DERIVATIVES - Hedged Items in Fair Value Hedging Relationships (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>9954499 - Disclosure - FINANCIAL DERIVATIVES - Schedule of Fair Value of Financial Assets and Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FINANCIALDERIVATIVESScheduleofFairValueofFinancialAssetsandLiabilitiesDetails</Role>
      <ShortName>FINANCIAL DERIVATIVES - Schedule of Fair Value of Financial Assets and Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>9954500 - Disclosure - LOANS - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/LOANSNarrativeDetails</Role>
      <ShortName>LOANS - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>9954501 - Disclosure - LOANS - Schedule of Composition of Loan Balances (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/LOANSScheduleofCompositionofLoanBalancesDetails</Role>
      <ShortName>LOANS - Schedule of Composition of Loan Balances (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>9954502 - Disclosure - LOANS - Allowance for Losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/LOANSAllowanceforLossesDetails</Role>
      <ShortName>LOANS - Allowance for Losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>9954503 - Disclosure - LOANS - Changes in the Allowance for Losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/LOANSChangesintheAllowanceforLossesDetails</Role>
      <ShortName>LOANS - Changes in the Allowance for Losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>9954504 - Disclosure - LOANS - Unpaid Principal Balances by Delinquency Status (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/LOANSUnpaidPrincipalBalancesbyDelinquencyStatusDetails</Role>
      <ShortName>LOANS - Unpaid Principal Balances by Delinquency Status (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>9954505 - Disclosure - LOANS - Schedule of Financing Receivables Credit Quality Indicators (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/LOANSScheduleofFinancingReceivablesCreditQualityIndicatorsDetails</Role>
      <ShortName>LOANS - Schedule of Financing Receivables Credit Quality Indicators (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>9954506 - Disclosure - GUARANTEES AND COMMITMENTS - Off-Balance Sheet Guaranteed Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTSOffBalanceSheetGuaranteedSecuritiesDetails</Role>
      <ShortName>GUARANTEES AND COMMITMENTS - Off-Balance Sheet Guaranteed Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>9954507 - Disclosure - GUARANTEES AND COMMITMENTS - Significant Cash Flows Received From and Paid to Trusts (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTSSignificantCashFlowsReceivedFromandPaidtoTrustsDetails</Role>
      <ShortName>GUARANTEES AND COMMITMENTS - Significant Cash Flows Received From and Paid to Trusts (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>9954508 - Disclosure - GUARANTEES AND COMMITMENTS - Schedule of Underlying Off-Balance Sheet Guaranteed Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTSScheduleofUnderlyingOffBalanceSheetGuaranteedSecuritiesDetails</Role>
      <ShortName>GUARANTEES AND COMMITMENTS - Schedule of Underlying Off-Balance Sheet Guaranteed Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>9954509 - Disclosure - GUARANTEES AND COMMITMENTS - Schedule of Long-Term Standby Purchase Commitments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTSScheduleofLongTermStandbyPurchaseCommitmentsDetails</Role>
      <ShortName>GUARANTEES AND COMMITMENTS - Schedule of Long-Term Standby Purchase Commitments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>9954510 - Disclosure - GUARANTEES AND COMMITMENTS - Reserve For Losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTSReserveForLossesDetails</Role>
      <ShortName>GUARANTEES AND COMMITMENTS - Reserve For Losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>9954511 - Disclosure - GUARANTEES AND COMMITMENTS - Changes in Reserve for Losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTSChangesinReserveforLossesDetails</Role>
      <ShortName>GUARANTEES AND COMMITMENTS - Changes in Reserve for Losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>9954512 - Disclosure - GUARANTEES AND COMMITMENTS - Unpaid Principal Balances by Delinquency Status (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTSUnpaidPrincipalBalancesbyDelinquencyStatusDetails</Role>
      <ShortName>GUARANTEES AND COMMITMENTS - Unpaid Principal Balances by Delinquency Status (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>9954513 - Disclosure - GUARANTEES AND COMMITMENTS - Credit Quality Indicators (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/GUARANTEESANDCOMMITMENTSCreditQualityIndicatorsDetails</Role>
      <ShortName>GUARANTEES AND COMMITMENTS - Credit Quality Indicators (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>9954514 - Disclosure - NOTES PAYABLE - Narrative (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.farmermac.com/role/NOTESPAYABLENarrativeDetails</Role>
      <ShortName>NOTES PAYABLE - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>64</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>9954515 - Disclosure - NOTES PAYABLE - Borrowings (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.farmermac.com/role/NOTESPAYABLEBorrowingsDetails</Role>
      <ShortName>NOTES PAYABLE - Borrowings (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>65</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>9954516 - Disclosure - NOTES PAYABLE - Callable Medium-Term Notes (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.farmermac.com/role/NOTESPAYABLECallableMediumTermNotesDetails</Role>
      <ShortName>NOTES PAYABLE - Callable Medium-Term Notes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>66</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>9954517 - Disclosure - NOTES PAYABLE - Earliest Interest Reset Date of Borrowing Outstanding (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.farmermac.com/role/NOTESPAYABLEEarliestInterestResetDateofBorrowingOutstandingDetails</Role>
      <ShortName>NOTES PAYABLE - Earliest Interest Reset Date of Borrowing Outstanding (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>67</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>9954518 - Disclosure - EQUITY (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/EQUITYDetails</Role>
      <ShortName>EQUITY (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/EQUITY</ParentRole>
      <Position>68</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>9954519 - Disclosure - FAIR VALUE DISCLOSURES - Schedule of Fair Value Measurements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FAIRVALUEDISCLOSURESScheduleofFairValueMeasurementsDetails</Role>
      <ShortName>FAIR VALUE DISCLOSURES - Schedule of Fair Value Measurements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>69</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>9954520 - Disclosure - FAIR VALUE DISCLOSURES - Schedule of Unobservable Input Reconciliation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FAIRVALUEDISCLOSURESScheduleofUnobservableInputReconciliationDetails</Role>
      <ShortName>FAIR VALUE DISCLOSURES - Schedule of Unobservable Input Reconciliation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>70</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R71.htm</HtmlFileName>
      <LongName>9954521 - Disclosure - FAIR VALUE DISCLOSURES - Quantitative Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FAIRVALUEDISCLOSURESQuantitativeInformationDetails</Role>
      <ShortName>FAIR VALUE DISCLOSURES - Quantitative Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>71</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R72.htm</HtmlFileName>
      <LongName>9954522 - Disclosure - FAIR VALUE DISCLOSURES - Summary of Carrying Value and Fair Value (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/FAIRVALUEDISCLOSURESSummaryofCarryingValueandFairValueDetails</Role>
      <ShortName>FAIR VALUE DISCLOSURES - Summary of Carrying Value and Fair Value (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>72</Position>
    </Report>
    <Report instance="agm-20240331.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R73.htm</HtmlFileName>
      <LongName>9954523 - Disclosure - BUSINESS SEGMENT REPORTING (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.farmermac.com/role/BUSINESSSEGMENTREPORTINGDetails</Role>
      <ShortName>BUSINESS SEGMENT REPORTING (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.farmermac.com/role/BUSINESSSEGMENTREPORTINGTables</ParentRole>
      <Position>73</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File doctype="10-Q" isDefinitelyFs="true" isUsgaap="true" original="agm-20240331.htm">agm-20240331.htm</File>
    <File>agm-20240331.xsd</File>
    <File>agm-20240331_cal.xml</File>
    <File>agm-20240331_def.xml</File>
    <File>agm-20240331_lab.xml</File>
    <File>agm-20240331_pre.xml</File>
  </InputFiles>
  <SupplementalFiles>
    <File>agm-20240331_g1.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy items="2255">http://fasb.org/us-gaap/2023</BaseTaxonomy>
    <BaseTaxonomy items="51">http://xbrl.sec.gov/dei/2023</BaseTaxonomy>
    <BaseTaxonomy items="4">http://xbrl.sec.gov/ecd/2023</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
