<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.26.3</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>356</ContextCount>
  <ElementCount>357</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>true</FootnotesReported>
  <SegmentCount>79</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>4</UnitCount>
  <MyReports>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0000001 - Document - Document and Entity Information Document</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DocumentandEntityInformationDocument</Role>
      <ShortName>Document and Entity Information Document</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>9952151 - Statement - Statements of Condition</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/StatementsofCondition</Role>
      <ShortName>Statements of Condition</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>9952152 - Statement - Statements of Condition (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/StatementsofConditionParenthetical</Role>
      <ShortName>Statements of Condition (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>9952153 - Statement - Statements of Income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/StatementsofIncome</Role>
      <ShortName>Statements of Income</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>9952154 - Statement - Statements of Comprehensive Income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/StatementsofComprehensiveIncome</Role>
      <ShortName>Statements of Comprehensive Income</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>9952155 - Statement - Statements of Capital Accounts</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/StatementsofCapitalAccounts</Role>
      <ShortName>Statements of Capital Accounts</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>9952156 - Statement - Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/StatementsofCashFlows</Role>
      <ShortName>Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>9952157 - Disclosure - Basis of Presentation and Significant Accounting Policies (Reports)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/BasisofPresentationandSignificantAccountingPoliciesReports</Role>
      <ShortName>Basis of Presentation and Significant Accounting Policies (Reports)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>9952158 - Disclosure - Recently Issued and Adopted Accounting Guidance (Reports)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/RecentlyIssuedandAdoptedAccountingGuidanceReports</Role>
      <ShortName>Recently Issued and Adopted Accounting Guidance (Reports)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>9952159 - Disclosure - Investments (Reports)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsReports</Role>
      <ShortName>Investments (Reports)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>9952160 - Disclosure - Advances (Reports)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesReports</Role>
      <ShortName>Advances (Reports)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>9952161 - Disclosure - Mortgage Loans (Reports)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/MortgageLoansReports</Role>
      <ShortName>Mortgage Loans (Reports)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>9952162 - Disclosure - Deposits</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/Deposits</Role>
      <ShortName>Deposits</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>9952163 - Disclosure - Consolidated Obligations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/ConsolidatedObligations</Role>
      <ShortName>Consolidated Obligations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>9952164 - Disclosure - Accumulated Other Comprehensive Income (Loss)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AccumulatedOtherComprehensiveIncomeLoss</Role>
      <ShortName>Accumulated Other Comprehensive Income (Loss)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>9952165 - Disclosure - Capital</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/Capital</Role>
      <ShortName>Capital</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>9952166 - Disclosure - Derivatives and Hedging Activities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DerivativesandHedgingActivities</Role>
      <ShortName>Derivatives and Hedging Activities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>9952167 - Disclosure - Fair Value</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/FairValue</Role>
      <ShortName>Fair Value</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>9952168 - Disclosure - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CommitmentsandContingencies</Role>
      <ShortName>Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>9952169 - Disclosure - Transactions with Certain Members, Certain Nonmembers, and Other FHLBanks</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/TransactionswithCertainMembersCertainNonmembersandOtherFHLBanks</Role>
      <ShortName>Transactions with Certain Members, Certain Nonmembers, and Other FHLBanks</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>9955511 - Disclosure - Basis of Presentation and Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/BasisofPresentationandSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Basis of Presentation and Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/BasisofPresentationandSignificantAccountingPoliciesReports</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>9955512 - Disclosure - Investments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsTables</Role>
      <ShortName>Investments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/InvestmentsReports</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>9955513 - Disclosure - Advances (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesTables</Role>
      <ShortName>Advances (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesReports</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>9955514 - Disclosure - Mortgage Loans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/MortgageLoansTables</Role>
      <ShortName>Mortgage Loans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/MortgageLoansReports</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>9955515 - Disclosure - Deposits (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DepositsTables</Role>
      <ShortName>Deposits (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/Deposits</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>9955516 - Disclosure - Consolidated Obligations (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/ConsolidatedObligationsTables</Role>
      <ShortName>Consolidated Obligations (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/ConsolidatedObligations</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>9955517 - Disclosure - Accumulated Other Comprehensive Income (Loss) (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AccumulatedOtherComprehensiveIncomeLossTables</Role>
      <ShortName>Accumulated Other Comprehensive Income (Loss) (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AccumulatedOtherComprehensiveIncomeLoss</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>9955518 - Disclosure - Capital (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CapitalTables</Role>
      <ShortName>Capital (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/Capital</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>9955519 - Disclosure - Derivatives and Hedging Activities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesTables</Role>
      <ShortName>Derivatives and Hedging Activities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/DerivativesandHedgingActivities</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>9955520 - Disclosure - Fair Value (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/FairValueTables</Role>
      <ShortName>Fair Value (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/FairValue</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>9955521 - Disclosure - Commitments and Contingencies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CommitmentsandContingenciesTables</Role>
      <ShortName>Commitments and Contingencies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/CommitmentsandContingencies</ParentRole>
      <Position>31</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>9955522 - Disclosure - Transactions with Certain Members, Certain Nonmembers, and Other FHLBanks (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/TransactionswithCertainMembersCertainNonmembersandOtherFHLBanksTables</Role>
      <ShortName>Transactions with Certain Members, Certain Nonmembers, and Other FHLBanks (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/TransactionswithCertainMembersCertainNonmembersandOtherFHLBanks</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>9955523 - Disclosure - Investments (Details) - Table - AFS Securities (Amortized Cost &amp; Fair Values)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsDetailsTableAFSSecuritiesAmortizedCostFairValues</Role>
      <ShortName>Investments (Details) - Table - AFS Securities (Amortized Cost &amp; Fair Values)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/InvestmentsTables</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>9955524 - Disclosure - Investments (Details) - Narrative - AFS Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsDetailsNarrativeAFSSecurities</Role>
      <ShortName>Investments (Details) - Narrative - AFS Securities</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/InvestmentsTables</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>9955525 - Disclosure - Investments (Details) - Table - AFS Securities (Unrealized Losses)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsDetailsTableAFSSecuritiesUnrealizedLosses</Role>
      <ShortName>Investments (Details) - Table - AFS Securities (Unrealized Losses)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/InvestmentsTables</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>9955526 - Disclosure - Investments (Details) - Table - AFS Securities (Redemption Terms)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsDetailsTableAFSSecuritiesRedemptionTerms</Role>
      <ShortName>Investments (Details) - Table - AFS Securities (Redemption Terms)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/InvestmentsTables</ParentRole>
      <Position>36</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>9955527 - Disclosure - Investments (Details) - Table - HTM Securities (Amortized Cost &amp; Fair Values)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsDetailsTableHTMSecuritiesAmortizedCostFairValues</Role>
      <ShortName>Investments (Details) - Table - HTM Securities (Amortized Cost &amp; Fair Values)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/InvestmentsTables</ParentRole>
      <Position>37</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>9955528 - Disclosure - Investments (Details) - Narrative - HTM Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsDetailsNarrativeHTMSecurities</Role>
      <ShortName>Investments (Details) - Narrative - HTM Securities</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/InvestmentsTables</ParentRole>
      <Position>38</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>9955529 - Disclosure - Investments (Details) - Narrative - PLRMBS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsDetailsNarrativePLRMBS</Role>
      <ShortName>Investments (Details) - Narrative - PLRMBS</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/InvestmentsTables</ParentRole>
      <Position>39</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>9955530 - Disclosure - Advances (Details) - Table - Redemption Terms</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesDetailsTableRedemptionTerms</Role>
      <ShortName>Advances (Details) - Table - Redemption Terms</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesTables</ParentRole>
      <Position>40</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>9955531 - Disclosure - Advances (Details) - Narrative - Miscellaneous</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesDetailsNarrativeMiscellaneous</Role>
      <ShortName>Advances (Details) - Narrative - Miscellaneous</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesTables</ParentRole>
      <Position>41</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>9955532 - Disclosure - Advances (Details) - Table - Redemption Terms (Includes Call, Put Dates)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesDetailsTableRedemptionTermsIncludesCallPutDates</Role>
      <ShortName>Advances (Details) - Table - Redemption Terms (Includes Call, Put Dates)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesTables</ParentRole>
      <Position>42</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>9955533 - Disclosure - Advances (Details) - Table - Concentration Risk</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesDetailsTableConcentrationRisk</Role>
      <ShortName>Advances (Details) - Table - Concentration Risk</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesTables</ParentRole>
      <Position>43</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>9955534 - Disclosure - Advances (Details) - Table - Interest Rate Terms</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesDetailsTableInterestRateTerms</Role>
      <ShortName>Advances (Details) - Table - Interest Rate Terms</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesTables</ParentRole>
      <Position>44</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>9955535 - Disclosure - Mortgage Loans (Details) - Table - Redemption Terms</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/MortgageLoansDetailsTableRedemptionTerms</Role>
      <ShortName>Mortgage Loans (Details) - Table - Redemption Terms</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/MortgageLoansTables</ParentRole>
      <Position>45</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>9955536 - Disclosure - Mortgage Loans (Details) - Table - Aging and Delinquency Statistics</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/MortgageLoansDetailsTableAgingandDelinquencyStatistics</Role>
      <ShortName>Mortgage Loans (Details) - Table - Aging and Delinquency Statistics</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/MortgageLoansTables</ParentRole>
      <Position>46</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>9955537 - Disclosure - Deposits (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DepositsDetails</Role>
      <ShortName>Deposits (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/DepositsTables</ParentRole>
      <Position>47</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>9955538 - Disclosure - Consolidated Obligations (Redemption Terms) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/ConsolidatedObligationsRedemptionTermsDetails</Role>
      <ShortName>Consolidated Obligations (Redemption Terms) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/ConsolidatedObligationsTables</ParentRole>
      <Position>48</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>9955539 - Disclosure - Consolidated Obligations (Consolidated Obligation Bonds Noncallable and Callable) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/ConsolidatedObligationsConsolidatedObligationBondsNoncallableandCallableDetails</Role>
      <ShortName>Consolidated Obligations (Consolidated Obligation Bonds Noncallable and Callable) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/ConsolidatedObligationsTables</ParentRole>
      <Position>49</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>9955540 - Disclosure - Consolidated Obligations (Consolidated Obligation Bonds by Earlier of Contractual Maturity or Next Call Date) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/ConsolidatedObligationsConsolidatedObligationBondsbyEarlierofContractualMaturityorNextCallDateDetails</Role>
      <ShortName>Consolidated Obligations (Consolidated Obligation Bonds by Earlier of Contractual Maturity or Next Call Date) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/ConsolidatedObligationsTables</ParentRole>
      <Position>50</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>9955541 - Disclosure - Consolidated Obligations (Consolidated Obligation Discount Notes) (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fhlbsf.com/role/ConsolidatedObligationsConsolidatedObligationDiscountNotesDetails</Role>
      <ShortName>Consolidated Obligations (Consolidated Obligation Discount Notes) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/ConsolidatedObligationsTables</ParentRole>
      <Position>51</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>9955542 - Disclosure - Consolidated Obligations (Interest Rate Payment Terms) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/ConsolidatedObligationsInterestRatePaymentTermsDetails</Role>
      <ShortName>Consolidated Obligations (Interest Rate Payment Terms) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/ConsolidatedObligationsTables</ParentRole>
      <Position>52</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>9955543 - Disclosure - Consolidated Obligations Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/ConsolidatedObligationsNarrativeDetails</Role>
      <ShortName>Consolidated Obligations Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>9955544 - Disclosure - Accumulated Other Comprehensive Income (Loss) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AccumulatedOtherComprehensiveIncomeLossDetails</Role>
      <ShortName>Accumulated Other Comprehensive Income (Loss) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AccumulatedOtherComprehensiveIncomeLossTables</ParentRole>
      <Position>54</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>9955545 - Disclosure - Capital (Capital Requirements) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CapitalCapitalRequirementsDetails</Role>
      <ShortName>Capital (Capital Requirements) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/CapitalTables</ParentRole>
      <Position>55</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>9955546 - Disclosure - Capital (Mandatorily Redeemable Capital Stock) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CapitalMandatorilyRedeemableCapitalStockDetails</Role>
      <ShortName>Capital (Mandatorily Redeemable Capital Stock) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/CapitalTables</ParentRole>
      <Position>56</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>9955547 - Disclosure - Capital - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CapitalAdditionalInformationDetails</Role>
      <ShortName>Capital - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>9955548 - Disclosure - Derivatives and Hedging Activities (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesNarrativeDetails</Role>
      <ShortName>Derivatives and Hedging Activities (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesTables</ParentRole>
      <Position>58</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>9955549 - Disclosure - Derivatives and Hedging Activities (Derivatives in Statement of Condition) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesDerivativesinStatementofConditionDetails</Role>
      <ShortName>Derivatives and Hedging Activities (Derivatives in Statement of Condition) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesTables</ParentRole>
      <Position>59</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>9955550 - Disclosure - Derivatives and Hedging Activities (Derivatives in Statement of Income) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesDerivativesinStatementofIncomeDetails</Role>
      <ShortName>Derivatives and Hedging Activities (Derivatives in Statement of Income) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesTables</ParentRole>
      <Position>60</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>9955551 - Disclosure - Derivatives and Hedging Activities Cumulative adjustments table (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesCumulativeadjustmentstableDetails</Role>
      <ShortName>Derivatives and Hedging Activities Cumulative adjustments table (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>9955552 - Disclosure - Derivatives and Hedging Activities (Derivatives in Statement of Income and Impact on Interest) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesDerivativesinStatementofIncomeandImpactonInterestDetails</Role>
      <ShortName>Derivatives and Hedging Activities (Derivatives in Statement of Income and Impact on Interest) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesTables</ParentRole>
      <Position>62</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>9955553 - Disclosure - Derivatives and Hedging Activities (Offsetting of Derivative Assets and Derivative Liabilities) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesOffsettingofDerivativeAssetsandDerivativeLiabilitiesDetails</Role>
      <ShortName>Derivatives and Hedging Activities (Offsetting of Derivative Assets and Derivative Liabilities) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/DerivativesandHedgingActivitiesTables</ParentRole>
      <Position>63</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>9955554 - Disclosure - Fair Value (Carrying Value and Fair Value of Financial Instruments) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/FairValueCarryingValueandFairValueofFinancialInstrumentsDetails</Role>
      <ShortName>Fair Value (Carrying Value and Fair Value of Financial Instruments) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/FairValueTables</ParentRole>
      <Position>64</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>9955555 - Disclosure - Fair Value (Fair Value Measured on Recurring and Nonrecurring Basis) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/FairValueFairValueMeasuredonRecurringandNonrecurringBasisDetails</Role>
      <ShortName>Fair Value (Fair Value Measured on Recurring and Nonrecurring Basis) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/FairValueTables</ParentRole>
      <Position>65</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>9955556 - Disclosure - Fair Value (Level 3) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/FairValueLevel3Details</Role>
      <ShortName>Fair Value (Level 3) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/FairValueTables</ParentRole>
      <Position>66</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>9955557 - Disclosure - Fair Value (Fair Value Option) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/FairValueFairValueOptionDetails</Role>
      <ShortName>Fair Value (Fair Value Option) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/FairValueTables</ParentRole>
      <Position>67</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>9955558 - Disclosure - Fair Value (Fair Value Difference Between Fair Value and Remaining Contractual Principal Balance Outstanding) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/FairValueFairValueDifferenceBetweenFairValueandRemainingContractualPrincipalBalanceOutstandingDetails</Role>
      <ShortName>Fair Value (Fair Value Difference Between Fair Value and Remaining Contractual Principal Balance Outstanding) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/FairValueTables</ParentRole>
      <Position>68</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>9955559 - Disclosure - Commitments and Contingencies Off-Balance Sheet Commitments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CommitmentsandContingenciesOffBalanceSheetCommitmentsDetails</Role>
      <ShortName>Commitments and Contingencies Off-Balance Sheet Commitments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>69</Position>
    </Report>
    <Report instance="fhlbsf-20260930.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>9955560 - Disclosure - Transactions with Certain Members, Certain Nonmembers, and Other FHLBanks (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/TransactionswithCertainMembersCertainNonmembersandOtherFHLBanksDetails</Role>
      <ShortName>Transactions with Certain Members, Certain Nonmembers, and Other FHLBanks (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/TransactionswithCertainMembersCertainNonmembersandOtherFHLBanksTables</ParentRole>
      <Position>70</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="fhlbsf-20260930.htm">fhlbsf-20260930.htm</File>
    <File>fhlbsf-20260930.xsd</File>
    <File>fhlbsf-20260930_cal.xml</File>
    <File>fhlbsf-20260930_def.xml</File>
    <File>fhlbsf-20260930_lab.xml</File>
    <File>fhlbsf-20260930_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="1481">http://fasb.org/us-gaap/2026</BaseTaxonomy>
    <BaseTaxonomy items="27">http://xbrl.sec.gov/dei/2026</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
