<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.20.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>479</ContextCount>
  <ElementCount>528</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>true</FootnotesReported>
  <SegmentCount>126</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>6</UnitCount>
  <MyReports>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0001000 - 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="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>1001000 - 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="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>1001001 - 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="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1002000 - 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="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1003000 - 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="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1004000 - 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="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>1004001 - Statement - Statements of Capital Accounts (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/StatementsOfCapitalAccountsParenthetical</Role>
      <ShortName>Statements of Capital Accounts (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>1005000 - 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>8</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>2105100 - Disclosure - Basis of Presentation (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fhlbsf.com/role/BasisOfPresentationNotes</Role>
      <ShortName>Basis of Presentation (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>2106100 - Disclosure - Recently Issued and Adopted Accounting Guidance</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/RecentlyIssuedAndAdoptedAccountingGuidance</Role>
      <ShortName>Recently Issued and Adopted Accounting Guidance</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>2110100 - Disclosure - Investments (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsNotes</Role>
      <ShortName>Investments (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>2113100 - Disclosure - Advances</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/Advances</Role>
      <ShortName>Advances</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>2114100 - Disclosure - Mortgage Loans Held for Portfolio</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/MortgageLoansHeldForPortfolio</Role>
      <ShortName>Mortgage Loans Held for Portfolio</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>2116100 - Disclosure - Deposits</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/Deposits</Role>
      <ShortName>Deposits</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>2117100 - Disclosure - Consolidated Obligations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/ConsolidatedObligations</Role>
      <ShortName>Consolidated Obligations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>2119100 - 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>16</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>2120100 - Disclosure - Capital</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/Capital</Role>
      <ShortName>Capital</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>2122100 - Disclosure - Segment Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/SegmentInformation</Role>
      <ShortName>Segment Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>2124100 - 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>19</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>2128100 - Disclosure - Fair Value</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/FairValue</Role>
      <ShortName>Fair Value</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>2131100 - 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>21</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>2145100 - 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>22</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>2147100 - Disclosure - Subsequent Events</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/SubsequentEvents</Role>
      <ShortName>Subsequent Events</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>2201201 - Disclosure - Summary of Significant Accounting Policies / Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/SummaryOfSignificantAccountingPoliciesAccountingPoliciesPolicies</Role>
      <ShortName>Summary of Significant Accounting Policies / Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/RecentlyIssuedAndAdoptedAccountingGuidance</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>2205201 - Disclosure - Basis of Presentation (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/BasisOfPresentationPolicies</Role>
      <ShortName>Basis of Presentation (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/RecentlyIssuedAndAdoptedAccountingGuidance</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>2310301 - 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/InvestmentsNotes</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>2313301 - 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/Advances</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>2314301 - Disclosure - Mortgage Loans Held for Portfolio (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/MortgageLoansHeldForPortfolioTables</Role>
      <ShortName>Mortgage Loans Held for Portfolio (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/MortgageLoansHeldForPortfolio</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>2316301 - 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>29</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>2317301 - 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>30</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>2319301 - 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>31</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>2320301 - 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>32</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>2322301 - Disclosure - Segment Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/SegmentInformationTables</Role>
      <ShortName>Segment Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/SegmentInformation</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>2324301 - 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>34</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>2328301 - 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>35</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>2331301 - 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>36</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>2345301 - 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>37</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>2410402 - Disclosure - Investments Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsNarrativeDetails</Role>
      <ShortName>Investments Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>2410403 - Disclosure - Investments Trading Securities by Major Type (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsTradingSecuritiesByMajorTypeDetails</Role>
      <ShortName>Investments Trading Securities by Major Type (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>2410404 - Disclosure - Investments AFS Securities by Major Type (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsAfsSecuritiesByMajorTypeDetails</Role>
      <ShortName>Investments AFS Securities by Major Type (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>2410405 - Disclosure - Investments Summary of AFS Securities with Unrealized Losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsSummaryOfAfsSecuritiesWithUnrealizedLossesDetails</Role>
      <ShortName>Investments Summary of AFS Securities with Unrealized Losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>2410406 - Disclosure - Investments AFS by Contractual Maturity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsAfsByContractualMaturityDetails</Role>
      <ShortName>Investments AFS by Contractual Maturity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>2410407 - Disclosure - Investments Classification of Held-to-Maturity Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsClassificationOfHeldToMaturitySecuritiesDetails</Role>
      <ShortName>Investments Classification of Held-to-Maturity Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>2410408 - Disclosure - Investments Significant Inputs on PLRMBS (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsSignificantInputsOnPlrmbsDetails</Role>
      <ShortName>Investments Significant Inputs on PLRMBS (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>2410409 - Disclosure - Investments OTTI Rollforward (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/InvestmentsOttiRollforwardDetails</Role>
      <ShortName>Investments OTTI Rollforward (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>2413402 - Disclosure - Advances (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesNarrativeDetails</Role>
      <ShortName>Advances (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesTables</ParentRole>
      <Position>46</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>2413403 - Disclosure - Advances (Redemption Terms) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesRedemptionTermsDetails</Role>
      <ShortName>Advances (Redemption Terms) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesTables</ParentRole>
      <Position>47</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>2413404 - Disclosure - Advances (Earlier of Contractual Maturity or Next Call/Put Date) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesEarlierOfContractualMaturityOrNextCallPutDateDetails</Role>
      <ShortName>Advances (Earlier of Contractual Maturity or Next Call/Put Date) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesTables</ParentRole>
      <Position>48</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>2413405 - Disclosure - Advances (Credit and Concentration Risk) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesCreditAndConcentrationRiskDetails</Role>
      <ShortName>Advances (Credit and Concentration Risk) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesTables</ParentRole>
      <Position>49</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>2413406 - Disclosure - Advances (Interest Rate Payment Terms and Prepayment Fees) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/AdvancesInterestRatePaymentTermsAndPrepaymentFeesDetails</Role>
      <ShortName>Advances (Interest Rate Payment Terms and Prepayment Fees) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/AdvancesTables</ParentRole>
      <Position>50</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>2414402 - Disclosure - Mortgage Loans Held for Portfolio (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/MortgageLoansHeldForPortfolioDetails</Role>
      <ShortName>Mortgage Loans Held for Portfolio (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/MortgageLoansHeldForPortfolioTables</ParentRole>
      <Position>51</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>2414403 - Disclosure - Mortgage Loans Held for Portfolio Delinquency Statistics (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/MortgageLoansHeldForPortfolioDelinquencyStatisticsDetails</Role>
      <ShortName>Mortgage Loans Held for Portfolio Delinquency Statistics (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>2414404 - Disclosure - Mortgage Loans Held for Portfolio Allowance Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/MortgageLoansHeldForPortfolioAllowanceNarrativeDetails</Role>
      <ShortName>Mortgage Loans Held for Portfolio Allowance Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>2416402 - 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>54</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>2417402 - 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>55</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>2417403 - 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>56</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>2417404 - 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>57</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>2417405 - 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>58</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>2417406 - 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>59</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>2417407 - 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>60</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>2419402 - 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>61</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>2420402 - 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>62</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>2420403 - 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>63</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>2420404 - Disclosure - Capital (By Redemption Period) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CapitalByRedemptionPeriodDetails</Role>
      <ShortName>Capital (By Redemption Period) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/CapitalTables</ParentRole>
      <Position>64</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>2420405 - Disclosure - Capital (Retained Earnings and Dividend Policy) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CapitalRetainedEarningsAndDividendPolicyDetails</Role>
      <ShortName>Capital (Retained Earnings and Dividend Policy) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/CapitalTables</ParentRole>
      <Position>65</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>2420406 - Disclosure - Capital (Excess Capital Stock) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CapitalExcessCapitalStockDetails</Role>
      <ShortName>Capital (Excess Capital Stock) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/CapitalTables</ParentRole>
      <Position>66</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>2420407 - Disclosure - Capital (Concentration) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/CapitalConcentrationDetails</Role>
      <ShortName>Capital (Concentration) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/CapitalTables</ParentRole>
      <Position>67</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>2422402 - Disclosure - Segment Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.fhlbsf.com/role/SegmentInformationDetails</Role>
      <ShortName>Segment Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.fhlbsf.com/role/SegmentInformationTables</ParentRole>
      <Position>68</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>2424402 - 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>69</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>2424403 - 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>70</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R71.htm</HtmlFileName>
      <LongName>2424404 - 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>71</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R72.htm</HtmlFileName>
      <LongName>2424405 - 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>72</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R73.htm</HtmlFileName>
      <LongName>2424406 - 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>73</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R74.htm</HtmlFileName>
      <LongName>2424407 - 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>74</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R75.htm</HtmlFileName>
      <LongName>2428402 - 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>75</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R76.htm</HtmlFileName>
      <LongName>2428403 - 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>76</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R77.htm</HtmlFileName>
      <LongName>2428404 - 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>77</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R78.htm</HtmlFileName>
      <LongName>2428405 - 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>78</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R79.htm</HtmlFileName>
      <LongName>2428406 - 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>79</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R80.htm</HtmlFileName>
      <LongName>2431402 - 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>80</Position>
    </Report>
    <Report instance="a2020q110qdocument.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R81.htm</HtmlFileName>
      <LongName>2445402 - 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>81</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" original="a2020q110qdocument.htm">a2020q110qdocument.htm</File>
    <File>a202010qq1ex311.htm</File>
    <File>a202010qq1ex312.htm</File>
    <File>a202010qq1ex321.htm</File>
    <File>a202010qq1ex322.htm</File>
    <File>ex41descriptionofregis.htm</File>
    <File>fhlbsf-20200331.xsd</File>
    <File>fhlbsf-20200331_cal.xml</File>
    <File>fhlbsf-20200331_def.xml</File>
    <File>fhlbsf-20200331_lab.xml</File>
    <File>fhlbsf-20200331_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy>http://fasb.org/srt/2019-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/dei/2019-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/us-gaap/2019-01-31</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
