<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.22.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>1238</ContextCount>
  <ElementCount>655</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>312</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>15</UnitCount>
  <MyReports>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>000010001 - Document - Cover</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Cover</Role>
      <ShortName>Cover</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>000020002 - Document - Audit Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/AuditInformation</Role>
      <ShortName>Audit Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>100010003 - Statement - Consolidated balance sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Consolidatedbalancesheets</Role>
      <ShortName>Consolidated balance sheets</ShortName>
      <MenuCategory>Uncategorized</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>100020004 - Statement - Consolidated statements of income and of comprehensive income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Consolidatedstatementsofincomeandofcomprehensiveincome</Role>
      <ShortName>Consolidated statements of income and of comprehensive income</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>100030005 - Statement - Consolidated statements of changes in equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Consolidatedstatementsofchangesinequity</Role>
      <ShortName>Consolidated statements of changes in equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>100040006 - Statement - Consolidated statements of cash flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Consolidatedstatementsofcashflows</Role>
      <ShortName>Consolidated statements of cash flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>210011001 - Disclosure - Operations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Operations</Role>
      <ShortName>Operations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>210031002 - Disclosure - Basis of preparation of the financial statements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Basisofpreparationofthefinancialstatements</Role>
      <ShortName>Basis of preparation of the financial statements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>210051003 - Disclosure - Summary of significant accounting policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Summaryofsignificantaccountingpolicies</Role>
      <ShortName>Summary of significant accounting policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>210111004 - Disclosure - Significant accounting judgements, estimates and assumptions</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Significantaccountingjudgementsestimatesandassumptions</Role>
      <ShortName>Significant accounting judgements, estimates and assumptions</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>210121005 - Disclosure - Group structure</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Groupstructure</Role>
      <ShortName>Group structure</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>210181006 - Disclosure - Securities purchased (sold) under resale (repurchase) agreements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Securitiespurchasedsoldunderresalerepurchaseagreements</Role>
      <ShortName>Securities purchased (sold) under resale (repurchase) agreements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>210231007 - Disclosure - Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Securities</Role>
      <ShortName>Securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>210301008 - Disclosure - Derivative financial instruments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Derivativefinancialinstruments</Role>
      <ShortName>Derivative financial instruments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>210351009 - Disclosure - Hedge accounting</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Hedgeaccounting</Role>
      <ShortName>Hedge accounting</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>210401010 - Disclosure - Loan operations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Loanoperations</Role>
      <ShortName>Loan operations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>210461011 - Disclosure - Accounts receivable</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Accountsreceivable</Role>
      <ShortName>Accounts receivable</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>210491012 - Disclosure - Recoverable taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Recoverabletaxes</Role>
      <ShortName>Recoverable taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>210521013 - Disclosure - Prepaid expenses</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Prepaidexpenses</Role>
      <ShortName>Prepaid expenses</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>210551014 - Disclosure - Expected Credit Losses on Financial Assets and Reconciliation of carrying amount</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ExpectedCreditLossesonFinancialAssetsandReconciliationofcarryingamount</Role>
      <ShortName>Expected Credit Losses on Financial Assets and Reconciliation of carrying amount</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>210621015 - Disclosure - Investments in associates and joint ventures</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Investmentsinassociatesandjointventures</Role>
      <ShortName>Investments in associates and joint ventures</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>210651016 - Disclosure - Property, equipment, intangible assets and leases</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Propertyequipmentintangibleassetsandleases</Role>
      <ShortName>Property, equipment, intangible assets and leases</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>210711017 - Disclosure - Financing instruments payable</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Financinginstrumentspayable</Role>
      <ShortName>Financing instruments payable</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>210771018 - Disclosure - Securities trading and intermediation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Securitiestradingandintermediation</Role>
      <ShortName>Securities trading and intermediation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>24</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>210801019 - Disclosure - Borrowings</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Borrowings</Role>
      <ShortName>Borrowings</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>25</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>210831020 - Disclosure - Other financial assets and financial liabilities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Otherfinancialassetsandfinancialliabilities</Role>
      <ShortName>Other financial assets and financial liabilities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>26</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>210871021 - Disclosure - Social and statutory obligations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Socialandstatutoryobligations</Role>
      <ShortName>Social and statutory obligations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>27</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>210911022 - Disclosure - Tax and social security obligations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Taxandsocialsecurityobligations</Role>
      <ShortName>Tax and social security obligations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>28</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>210951023 - Disclosure - Private pension liabilities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Privatepensionliabilities</Role>
      <ShortName>Private pension liabilities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>29</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>210981024 - Disclosure - Income tax</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Incometax</Role>
      <ShortName>Income tax</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>211051025 - Disclosure - Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Equity</Role>
      <ShortName>Equity</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>211091026 - Disclosure - Related party transactions</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Relatedpartytransactions</Role>
      <ShortName>Related party transactions</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>211131027 - Disclosure - Provisions and contingent liabilities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Provisionsandcontingentliabilities</Role>
      <ShortName>Provisions and contingent liabilities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>211191028 - Disclosure - Total revenue and income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Totalrevenueandincome</Role>
      <ShortName>Total revenue and income</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>211241029 - Disclosure - Operating costs</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Operatingcosts</Role>
      <ShortName>Operating costs</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>211271030 - Disclosure - Operating expenses by nature</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Operatingexpensesbynature</Role>
      <ShortName>Operating expenses by nature</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>211301031 - Disclosure - Other operating income, net</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Otheroperatingincomenet</Role>
      <ShortName>Other operating income, net</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>211331032 - Disclosure - Share-based plan</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Sharebasedplan</Role>
      <ShortName>Share-based plan</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>211371033 - Disclosure - Earnings per share (basic and diluted)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Earningspersharebasicanddiluted</Role>
      <ShortName>Earnings per share (basic and diluted)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>211401034 - Disclosure - Determination of fair value</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Determinationoffairvalue</Role>
      <ShortName>Determination of fair value</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>211431035 - Disclosure - Management of financial risks and financial instruments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Managementoffinancialrisksandfinancialinstruments</Role>
      <ShortName>Management of financial risks and financial instruments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>211491036 - Disclosure - Capital management</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Capitalmanagement</Role>
      <ShortName>Capital management</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>211531037 - Disclosure - Cash flow information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Cashflowinformation</Role>
      <ShortName>Cash flow information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>211571038 - Disclosure - Subsequent events</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/Subsequentevents</Role>
      <ShortName>Subsequent events</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>220062001 - Disclosure - Summary of significant accounting policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SummaryofsignificantaccountingpoliciesPolicies</Role>
      <ShortName>Summary of significant accounting policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>230073001 - Disclosure - Summary of significant accounting policies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SummaryofsignificantaccountingpoliciesTables</Role>
      <ShortName>Summary of significant accounting policies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Summaryofsignificantaccountingpolicies</ParentRole>
      <Position>46</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>230133002 - Disclosure - Group structure (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/GroupstructureTables</Role>
      <ShortName>Group structure (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Groupstructure</ParentRole>
      <Position>47</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>230193003 - Disclosure - Securities purchased (sold) under resale (repurchase) agreements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiespurchasedsoldunderresalerepurchaseagreementsTables</Role>
      <ShortName>Securities purchased (sold) under resale (repurchase) agreements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Securitiespurchasedsoldunderresalerepurchaseagreements</ParentRole>
      <Position>48</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>230243004 - Disclosure - Securities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiesTables</Role>
      <ShortName>Securities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Securitiespurchasedsoldunderresalerepurchaseagreements</ParentRole>
      <Position>49</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>230313005 - Disclosure - Derivative financial instruments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/DerivativefinancialinstrumentsTables</Role>
      <ShortName>Derivative financial instruments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Derivativefinancialinstruments</ParentRole>
      <Position>50</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>230363006 - Disclosure - Hedge accounting (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/HedgeaccountingTables</Role>
      <ShortName>Hedge accounting (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Hedgeaccounting</ParentRole>
      <Position>51</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>230413007 - Disclosure - Loan operations (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/LoanoperationsTables</Role>
      <ShortName>Loan operations (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Loanoperations</ParentRole>
      <Position>52</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>230473008 - Disclosure - Accounts receivable (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/AccountsreceivableTables</Role>
      <ShortName>Accounts receivable (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Accountsreceivable</ParentRole>
      <Position>53</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>230503009 - Disclosure - Recoverable taxes (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/RecoverabletaxesTables</Role>
      <ShortName>Recoverable taxes (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Recoverabletaxes</ParentRole>
      <Position>54</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>230533010 - Disclosure - Prepaid expenses (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/PrepaidexpensesTables</Role>
      <ShortName>Prepaid expenses (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Prepaidexpenses</ParentRole>
      <Position>55</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>230563011 - Disclosure - Expected credit losses on financial assets and reconciliation of carrying amount (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ExpectedcreditlossesonfinancialassetsandreconciliationofcarryingamountTables</Role>
      <ShortName>Expected credit losses on financial assets and reconciliation of carrying amount (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>230633012 - Disclosure - Investments in associates and joint ventures (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/InvestmentsinassociatesandjointventuresTables</Role>
      <ShortName>Investments in associates and joint ventures (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Investmentsinassociatesandjointventures</ParentRole>
      <Position>57</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>230663013 - Disclosure - Property, equipment, intangible assets and leases (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/PropertyequipmentintangibleassetsandleasesTables</Role>
      <ShortName>Property, equipment, intangible assets and leases (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Propertyequipmentintangibleassetsandleases</ParentRole>
      <Position>58</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>230723014 - Disclosure - Financing instruments payable (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/FinancinginstrumentspayableTables</Role>
      <ShortName>Financing instruments payable (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Financinginstrumentspayable</ParentRole>
      <Position>59</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>230783015 - Disclosure - Securities trading and intermediation (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiestradingandintermediationTables</Role>
      <ShortName>Securities trading and intermediation (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Securitiestradingandintermediation</ParentRole>
      <Position>60</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>230813016 - Disclosure - Borrowings (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/BorrowingsTables</Role>
      <ShortName>Borrowings (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Borrowings</ParentRole>
      <Position>61</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>230843017 - Disclosure - Other financial assets and financial liabilities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/OtherfinancialassetsandfinancialliabilitiesTables</Role>
      <ShortName>Other financial assets and financial liabilities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Otherfinancialassetsandfinancialliabilities</ParentRole>
      <Position>62</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>230883018 - Disclosure - Social and statutory obligations (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SocialandstatutoryobligationsTables</Role>
      <ShortName>Social and statutory obligations (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Socialandstatutoryobligations</ParentRole>
      <Position>63</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>230923019 - Disclosure - Tax and social security obligations (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/TaxandsocialsecurityobligationsTables</Role>
      <ShortName>Tax and social security obligations (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Taxandsocialsecurityobligations</ParentRole>
      <Position>64</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>230963020 - Disclosure - Private pension liabilities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/PrivatepensionliabilitiesTables</Role>
      <ShortName>Private pension liabilities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Privatepensionliabilities</ParentRole>
      <Position>65</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>230993021 - Disclosure - Income tax (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/IncometaxTables</Role>
      <ShortName>Income tax (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Incometax</ParentRole>
      <Position>66</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>231063022 - Disclosure - Equity (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/EquityTables</Role>
      <ShortName>Equity (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Equity</ParentRole>
      <Position>67</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>231103023 - Disclosure - Related party transactions (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/RelatedpartytransactionsTables</Role>
      <ShortName>Related party transactions (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Relatedpartytransactions</ParentRole>
      <Position>68</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>231143024 - Disclosure - Provisions and contingent liabilities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ProvisionsandcontingentliabilitiesTables</Role>
      <ShortName>Provisions and contingent liabilities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Provisionsandcontingentliabilities</ParentRole>
      <Position>69</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>231203025 - Disclosure - Total revenue and income (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/TotalrevenueandincomeTables</Role>
      <ShortName>Total revenue and income (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Totalrevenueandincome</ParentRole>
      <Position>70</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R71.htm</HtmlFileName>
      <LongName>231253026 - Disclosure - Operating costs (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/OperatingcostsTables</Role>
      <ShortName>Operating costs (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Operatingcosts</ParentRole>
      <Position>71</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R72.htm</HtmlFileName>
      <LongName>231283027 - Disclosure - Operating expenses by nature (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/OperatingexpensesbynatureTables</Role>
      <ShortName>Operating expenses by nature (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Operatingexpensesbynature</ParentRole>
      <Position>72</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R73.htm</HtmlFileName>
      <LongName>231313028 - Disclosure - Other operating income, net (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/OtheroperatingincomenetTables</Role>
      <ShortName>Other operating income, net (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Otheroperatingincomenet</ParentRole>
      <Position>73</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R74.htm</HtmlFileName>
      <LongName>231343029 - Disclosure - Share-based plan (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SharebasedplanTables</Role>
      <ShortName>Share-based plan (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Sharebasedplan</ParentRole>
      <Position>74</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R75.htm</HtmlFileName>
      <LongName>231383030 - Disclosure - Earnings per share (basic and diluted) (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/EarningspersharebasicanddilutedTables</Role>
      <ShortName>Earnings per share (basic and diluted) (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Earningspersharebasicanddiluted</ParentRole>
      <Position>75</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R76.htm</HtmlFileName>
      <LongName>231413031 - Disclosure - Determination of fair value (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/DeterminationoffairvalueTables</Role>
      <ShortName>Determination of fair value (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Determinationoffairvalue</ParentRole>
      <Position>76</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R77.htm</HtmlFileName>
      <LongName>231443032 - Disclosure - Management of financial risks and financial instruments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ManagementoffinancialrisksandfinancialinstrumentsTables</Role>
      <ShortName>Management of financial risks and financial instruments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Managementoffinancialrisksandfinancialinstruments</ParentRole>
      <Position>77</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R78.htm</HtmlFileName>
      <LongName>231503033 - Disclosure - Capital management (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/CapitalmanagementTables</Role>
      <ShortName>Capital management (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Capitalmanagement</ParentRole>
      <Position>78</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R79.htm</HtmlFileName>
      <LongName>231543034 - Disclosure - Cash flow information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/CashflowinformationTables</Role>
      <ShortName>Cash flow information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://xpinc.com/role/Cashflowinformation</ParentRole>
      <Position>79</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R80.htm</HtmlFileName>
      <LongName>240024001 - Disclosure - Operations - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/OperationsAdditionalinformationDetails</Role>
      <ShortName>Operations - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>80</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R81.htm</HtmlFileName>
      <LongName>240044002 - Disclosure - Basis of preparation of the financial statements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/BasisofpreparationofthefinancialstatementsDetails</Role>
      <ShortName>Basis of preparation of the financial statements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/Basisofpreparationofthefinancialstatements</ParentRole>
      <Position>81</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R82.htm</HtmlFileName>
      <LongName>240084003 - Disclosure - Summary of significant accounting policies - Summary of depreciation of property and equipment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SummaryofsignificantaccountingpoliciesSummaryofdepreciationofpropertyandequipmentDetails</Role>
      <ShortName>Summary of significant accounting policies - Summary of depreciation of property and equipment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>82</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R83.htm</HtmlFileName>
      <LongName>240094004 - Disclosure - Summary of significant accounting policies - Summary of useful lives of intangible assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SummaryofsignificantaccountingpoliciesSummaryofusefullivesofintangibleassetsDetails</Role>
      <ShortName>Summary of significant accounting policies - Summary of useful lives of intangible assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>83</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R84.htm</HtmlFileName>
      <LongName>240104005 - Disclosure - Summary of significant accounting policies - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SummaryofsignificantaccountingpoliciesAdditionalinformationDetails</Role>
      <ShortName>Summary of significant accounting policies - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>84</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R85.htm</HtmlFileName>
      <LongName>240144006 - Disclosure - Group structure - Summary of direct and indirect interests of company in its subsidiaries (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/GroupstructureSummaryofdirectandindirectinterestsofcompanyinitssubsidiariesDetails</Role>
      <ShortName>Group structure - Summary of direct and indirect interests of company in its subsidiaries (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>85</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R86.htm</HtmlFileName>
      <LongName>240154007 - Disclosure - Group structure - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/GroupstructureAdditionalinformationDetails</Role>
      <ShortName>Group structure - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>86</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R87.htm</HtmlFileName>
      <LongName>240164008 - Disclosure - Group structure - Summary of the net assets acquired, the goodwill (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/GroupstructureSummaryofthenetassetsacquiredthegoodwillDetails</Role>
      <ShortName>Group structure - Summary of the net assets acquired, the goodwill (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>87</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R88.htm</HtmlFileName>
      <LongName>240174009 - Disclosure - Group structure - Summary of intangible assets acquired (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/GroupstructureSummaryofintangibleassetsacquiredDetails</Role>
      <ShortName>Group structure - Summary of intangible assets acquired (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>88</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R89.htm</HtmlFileName>
      <LongName>240204010 - Disclosure - Securities purchased (sold) under resale (repurchase) agreements - Summary of securities purchased under agreements to resell (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiespurchasedsoldunderresalerepurchaseagreementsSummaryofsecuritiespurchasedunderagreementstoresellDetails</Role>
      <ShortName>Securities purchased (sold) under resale (repurchase) agreements - Summary of securities purchased under agreements to resell (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/SecuritiespurchasedsoldunderresalerepurchaseagreementsTables</ParentRole>
      <Position>89</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R90.htm</HtmlFileName>
      <LongName>240214011 - Disclosure - Securities purchased (sold) under resale (repurchase) agreements - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiespurchasedsoldunderresalerepurchaseagreementsAdditionalinformationDetails</Role>
      <ShortName>Securities purchased (sold) under resale (repurchase) agreements - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/SecuritiespurchasedsoldunderresalerepurchaseagreementsTables</ParentRole>
      <Position>90</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R91.htm</HtmlFileName>
      <LongName>240224012 - Disclosure - Securities purchased (sold) under resale (repurchase) agreements - Securities sold under repurchase agreements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiespurchasedsoldunderresalerepurchaseagreementsSecuritiessoldunderrepurchaseagreementsDetails</Role>
      <ShortName>Securities purchased (sold) under resale (repurchase) agreements - Securities sold under repurchase agreements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/SecuritiespurchasedsoldunderresalerepurchaseagreementsTables</ParentRole>
      <Position>91</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R92.htm</HtmlFileName>
      <LongName>240254013 - Disclosure - Securities - Summary of Securities Classified at Fair Value Through Profit or Loss (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiesSummaryofSecuritiesClassifiedatFairValueThroughProfitorLossDetails</Role>
      <ShortName>Securities - Summary of Securities Classified at Fair Value Through Profit or Loss (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>92</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R93.htm</HtmlFileName>
      <LongName>240264014 - Disclosure - Securities - Summary of Securities at Fair Value Through Other Comprehensive Income (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiesSummaryofSecuritiesatFairValueThroughOtherComprehensiveIncomeDetails</Role>
      <ShortName>Securities - Summary of Securities at Fair Value Through Other Comprehensive Income (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>93</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R94.htm</HtmlFileName>
      <LongName>240274015 - Disclosure - Securities - Summary of Securities Evaluated at Amortized Cost (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiesSummaryofSecuritiesEvaluatedatAmortizedCostDetails</Role>
      <ShortName>Securities - Summary of Securities Evaluated at Amortized Cost (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>94</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R95.htm</HtmlFileName>
      <LongName>240284016 - Disclosure - Securities - Summary of Securities on the Financial Liabilities Classified at Fair Value Through Profit or Loss (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiesSummaryofSecuritiesontheFinancialLiabilitiesClassifiedatFairValueThroughProfitorLossDetails</Role>
      <ShortName>Securities - Summary of Securities on the Financial Liabilities Classified at Fair Value Through Profit or Loss (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>95</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R96.htm</HtmlFileName>
      <LongName>240294017 - Disclosure - Securities - Summary of Securities Classified by Maturity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiesSummaryofSecuritiesClassifiedbyMaturityDetails</Role>
      <ShortName>Securities - Summary of Securities Classified by Maturity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>96</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R97.htm</HtmlFileName>
      <LongName>240324018 - Disclosure - Derivative financial instruments - Summary of positions with derivative financial instruments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/DerivativefinancialinstrumentsSummaryofpositionswithderivativefinancialinstrumentsDetails</Role>
      <ShortName>Derivative financial instruments - Summary of positions with derivative financial instruments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>97</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R98.htm</HtmlFileName>
      <LongName>240334019 - Disclosure - Derivative financial instruments - Summary of derivative financial instruments portfolio (assets and liabilities) by type of instrument (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/DerivativefinancialinstrumentsSummaryofderivativefinancialinstrumentsportfolioassetsandliabilitiesbytypeofinstrumentDetails</Role>
      <ShortName>Derivative financial instruments - Summary of derivative financial instruments portfolio (assets and liabilities) by type of instrument (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>98</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R99.htm</HtmlFileName>
      <LongName>240344020 - Disclosure - Derivative financial instruments - Summary of derivative financial instruments by index (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/DerivativefinancialinstrumentsSummaryofderivativefinancialinstrumentsbyindexDetails</Role>
      <ShortName>Derivative financial instruments - Summary of derivative financial instruments by index (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>99</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R100.htm</HtmlFileName>
      <LongName>240374021 - Disclosure - Hedge accounting - Summary of detailed information about hedging instruments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/HedgeaccountingSummaryofdetailedinformationabouthedginginstrumentsDetails</Role>
      <ShortName>Hedge accounting - Summary of detailed information about hedging instruments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>100</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R101.htm</HtmlFileName>
      <LongName>240384022 - Disclosure - Hedge accounting - Hedged item information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/HedgeaccountingHedgediteminformationDetails</Role>
      <ShortName>Hedge accounting - Hedged item information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>101</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R102.htm</HtmlFileName>
      <LongName>240394023 - Disclosure - Hedge accounting - Hedged item maturity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/HedgeaccountingHedgeditemmaturityDetails</Role>
      <ShortName>Hedge accounting - Hedged item maturity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>102</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R103.htm</HtmlFileName>
      <LongName>240424024 - Disclosure - Loan operations - Loan operations by type (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/LoanoperationsLoanoperationsbytypeDetails</Role>
      <ShortName>Loan operations - Loan operations by type (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>103</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R104.htm</HtmlFileName>
      <LongName>240434025 - Disclosure - Loan operations - Loan operations by maturity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/LoanoperationsLoanoperationsbymaturityDetails</Role>
      <ShortName>Loan operations - Loan operations by maturity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>104</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R105.htm</HtmlFileName>
      <LongName>240444026 - Disclosure - Loan operations - Loan operations by concentration (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/LoanoperationsLoanoperationsbyconcentrationDetails</Role>
      <ShortName>Loan operations - Loan operations by concentration (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>105</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R106.htm</HtmlFileName>
      <LongName>240454027 - Disclosure - Loan operations - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/LoanoperationsAdditionalinformationDetails</Role>
      <ShortName>Loan operations - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>106</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R107.htm</HtmlFileName>
      <LongName>240484028 - Disclosure - Accounts receivable (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/AccountsreceivableDetails</Role>
      <ShortName>Accounts receivable (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/AccountsreceivableTables</ParentRole>
      <Position>107</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R108.htm</HtmlFileName>
      <LongName>240514029 - Disclosure - Recoverable taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/RecoverabletaxesDetails</Role>
      <ShortName>Recoverable taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/RecoverabletaxesTables</ParentRole>
      <Position>108</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R109.htm</HtmlFileName>
      <LongName>240544030 - Disclosure - Prepaid expenses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/PrepaidexpensesDetails</Role>
      <ShortName>Prepaid expenses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/PrepaidexpensesTables</ParentRole>
      <Position>109</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R110.htm</HtmlFileName>
      <LongName>240574031 - Disclosure - Expected Credit Losses on Financial Assets and Reconciliation of carrying amount (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ExpectedCreditLossesonFinancialAssetsandReconciliationofcarryingamountDetails</Role>
      <ShortName>Expected Credit Losses on Financial Assets and Reconciliation of carrying amount (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/ExpectedCreditLossesonFinancialAssetsandReconciliationofcarryingamount</ParentRole>
      <Position>110</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R111.htm</HtmlFileName>
      <LongName>240584032 - Disclosure - Expected Credit Losses on Financial Assets and Reconciliation of carrying amount - ECLs measured using simplified approach (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ExpectedCreditLossesonFinancialAssetsandReconciliationofcarryingamountECLsmeasuredusingsimplifiedapproachDetails</Role>
      <ShortName>Expected Credit Losses on Financial Assets and Reconciliation of carrying amount - ECLs measured using simplified approach (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>111</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R112.htm</HtmlFileName>
      <LongName>240594033 - Disclosure - Expected Credit Losses on Financial Assets and Reconciliation of carrying amount - Expected credit losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ExpectedCreditLossesonFinancialAssetsandReconciliationofcarryingamountExpectedcreditlossesDetails</Role>
      <ShortName>Expected Credit Losses on Financial Assets and Reconciliation of carrying amount - Expected credit losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>112</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R113.htm</HtmlFileName>
      <LongName>240604034 - Disclosure - Expected Credit Losses on Financial Assets and Reconciliation of carrying amount - Expected credit loss using simplified method (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ExpectedCreditLossesonFinancialAssetsandReconciliationofcarryingamountExpectedcreditlossusingsimplifiedmethodDetails</Role>
      <ShortName>Expected Credit Losses on Financial Assets and Reconciliation of carrying amount - Expected credit loss using simplified method (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>113</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R114.htm</HtmlFileName>
      <LongName>240614035 - Disclosure - Expected Credit Losses on Financial Assets and Reconciliation of carrying amount - Expected credit loss segregated by product (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ExpectedCreditLossesonFinancialAssetsandReconciliationofcarryingamountExpectedcreditlosssegregatedbyproductDetails</Role>
      <ShortName>Expected Credit Losses on Financial Assets and Reconciliation of carrying amount - Expected credit loss segregated by product (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>114</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R115.htm</HtmlFileName>
      <LongName>240644036 - Disclosure - Investments in associates and joint ventures (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/InvestmentsinassociatesandjointventuresDetails</Role>
      <ShortName>Investments in associates and joint ventures (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/InvestmentsinassociatesandjointventuresTables</ParentRole>
      <Position>115</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R116.htm</HtmlFileName>
      <LongName>240674037 - Disclosure - Property, equipment, intangible assets and leases - Summary of property and equipment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/PropertyequipmentintangibleassetsandleasesSummaryofpropertyandequipmentDetails</Role>
      <ShortName>Property, equipment, intangible assets and leases - Summary of property and equipment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>116</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R117.htm</HtmlFileName>
      <LongName>240684038 - Disclosure - Property, equipment, intangible assets and leases - Summary of intangible assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/PropertyequipmentintangibleassetsandleasesSummaryofintangibleassetsDetails</Role>
      <ShortName>Property, equipment, intangible assets and leases - Summary of intangible assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>117</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R118.htm</HtmlFileName>
      <LongName>240694039 - Disclosure - Property, equipment, intangible assets and leases - Additional details (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/PropertyequipmentintangibleassetsandleasesAdditionaldetailsDetails</Role>
      <ShortName>Property, equipment, intangible assets and leases - Additional details (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>118</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R119.htm</HtmlFileName>
      <LongName>240704040 - Disclosure - Property, equipment, intangible assets and leases - Summary of right-of-use assets and lease liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/PropertyequipmentintangibleassetsandleasesSummaryofrightofuseassetsandleaseliabilitiesDetails</Role>
      <ShortName>Property, equipment, intangible assets and leases - Summary of right-of-use assets and lease liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>119</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R120.htm</HtmlFileName>
      <LongName>240734041 - Disclosure - Financing instruments payable - Schedule (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/FinancinginstrumentspayableScheduleDetails</Role>
      <ShortName>Financing instruments payable - Schedule (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>120</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R121.htm</HtmlFileName>
      <LongName>240744042 - Disclosure - Financing instruments payable - Maturity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/FinancinginstrumentspayableMaturityDetails</Role>
      <ShortName>Financing instruments payable - Maturity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>121</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R122.htm</HtmlFileName>
      <LongName>240754043 - Disclosure - Financing instruments payable - Debt securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/FinancinginstrumentspayableDebtsecuritiesDetails</Role>
      <ShortName>Financing instruments payable - Debt securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>122</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R123.htm</HtmlFileName>
      <LongName>240764044 - Disclosure - Financing instruments payable - Debt securities, additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/FinancinginstrumentspayableDebtsecuritiesadditionalinformationDetails</Role>
      <ShortName>Financing instruments payable - Debt securities, additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>123</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R124.htm</HtmlFileName>
      <LongName>240794045 - Disclosure - Securities trading and intermediation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SecuritiestradingandintermediationDetails</Role>
      <ShortName>Securities trading and intermediation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/SecuritiestradingandintermediationTables</ParentRole>
      <Position>124</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R125.htm</HtmlFileName>
      <LongName>240824046 - Disclosure - Borrowings (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/BorrowingsDetails</Role>
      <ShortName>Borrowings (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/BorrowingsTables</ParentRole>
      <Position>125</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R126.htm</HtmlFileName>
      <LongName>240854047 - Disclosure - Other financial assets and financial liabilities - Other financial assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/OtherfinancialassetsandfinancialliabilitiesOtherfinancialassetsDetails</Role>
      <ShortName>Other financial assets and financial liabilities - Other financial assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>126</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R127.htm</HtmlFileName>
      <LongName>240864048 - Disclosure - Other financial assets and financial liabilities - Other financial liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/OtherfinancialassetsandfinancialliabilitiesOtherfinancialliabilitiesDetails</Role>
      <ShortName>Other financial assets and financial liabilities - Other financial liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>127</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R128.htm</HtmlFileName>
      <LongName>240894049 - Disclosure - Social and statutory obligations - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SocialandstatutoryobligationsAdditionalinformationDetails</Role>
      <ShortName>Social and statutory obligations - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>128</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R129.htm</HtmlFileName>
      <LongName>240904050 - Disclosure - Social and statutory obligations - Summary of social and statutory obligations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SocialandstatutoryobligationsSummaryofsocialandstatutoryobligationsDetails</Role>
      <ShortName>Social and statutory obligations - Summary of social and statutory obligations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>129</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R130.htm</HtmlFileName>
      <LongName>240934051 - Disclosure - Tax and social security obligations - Summary of Tax and Social Security Obligations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/TaxandsocialsecurityobligationsSummaryofTaxandSocialSecurityObligationsDetails</Role>
      <ShortName>Tax and social security obligations - Summary of Tax and Social Security Obligations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>130</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R131.htm</HtmlFileName>
      <LongName>240944052 - Disclosure - Tax and social security obligations - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/TaxandsocialsecurityobligationsAdditionalInformationDetails</Role>
      <ShortName>Tax and social security obligations - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>131</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R132.htm</HtmlFileName>
      <LongName>240974053 - Disclosure - Private pension liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/PrivatepensionliabilitiesDetails</Role>
      <ShortName>Private pension liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/PrivatepensionliabilitiesTables</ParentRole>
      <Position>132</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R133.htm</HtmlFileName>
      <LongName>241004054 - Disclosure - Income tax - Summary of components of deferred tax assets and deferred tax liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/IncometaxSummaryofcomponentsofdeferredtaxassetsanddeferredtaxliabilitiesDetails</Role>
      <ShortName>Income tax - Summary of components of deferred tax assets and deferred tax liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>133</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R134.htm</HtmlFileName>
      <LongName>241014055 - Disclosure - Income tax - Summary of reconciliation of changes in deferred tax liability asset (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/IncometaxSummaryofreconciliationofchangesindeferredtaxliabilityassetDetails</Role>
      <ShortName>Income tax - Summary of reconciliation of changes in deferred tax liability asset (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>134</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R135.htm</HtmlFileName>
      <LongName>241024056 - Disclosure - Income tax - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/IncometaxAdditionalinformationDetails</Role>
      <ShortName>Income tax - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>135</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R136.htm</HtmlFileName>
      <LongName>241034057 - Disclosure - Income tax - Summary of income tax calculation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/IncometaxSummaryofincometaxcalculationDetails</Role>
      <ShortName>Income tax - Summary of income tax calculation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>136</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R137.htm</HtmlFileName>
      <LongName>241044058 - Disclosure - Income tax - Summary of analysis of other comprehensive income by item (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/IncometaxSummaryofanalysisofothercomprehensiveincomebyitemDetails</Role>
      <ShortName>Income tax - Summary of analysis of other comprehensive income by item (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>137</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R138.htm</HtmlFileName>
      <LongName>241074059 - Disclosure - Equity - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/EquityAdditionalinformationDetails</Role>
      <ShortName>Equity - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>138</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R139.htm</HtmlFileName>
      <LongName>241084060 - Disclosure - Equity - Summary of issuances and conversations of shares (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/EquitySummaryofissuancesandconversationsofsharesDetails</Role>
      <ShortName>Equity - Summary of issuances and conversations of shares (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>139</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R140.htm</HtmlFileName>
      <LongName>241114061 - Disclosure - Related party transactions - Summary of key management personnel compensation expense (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/RelatedpartytransactionsSummaryofkeymanagementpersonnelcompensationexpenseDetails</Role>
      <ShortName>Related party transactions - Summary of key management personnel compensation expense (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>140</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R141.htm</HtmlFileName>
      <LongName>241124062 - Disclosure - Related party transactions - Summary of transactions between related parties explanatory (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/RelatedpartytransactionsSummaryoftransactionsbetweenrelatedpartiesexplanatoryDetails</Role>
      <ShortName>Related party transactions - Summary of transactions between related parties explanatory (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>141</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R142.htm</HtmlFileName>
      <LongName>241154063 - Disclosure - Provisions and contingent liabilities - Summary of other provisions (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ProvisionsandcontingentliabilitiesSummaryofotherprovisionsDetails</Role>
      <ShortName>Provisions and contingent liabilities - Summary of other provisions (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>142</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R143.htm</HtmlFileName>
      <LongName>241164064 - Disclosure - Provisions and contingent liabilities - Summary of changes in other provisions (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ProvisionsandcontingentliabilitiesSummaryofchangesinotherprovisionsDetails</Role>
      <ShortName>Provisions and contingent liabilities - Summary of changes in other provisions (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>143</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R144.htm</HtmlFileName>
      <LongName>241174065 - Disclosure - Provisions and contingent liabilities - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ProvisionsandcontingentliabilitiesAdditionalinformationDetails</Role>
      <ShortName>Provisions and contingent liabilities - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>144</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R145.htm</HtmlFileName>
      <LongName>241184066 - Disclosure - Provisions and contingent liabilities - Summary of contingent liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ProvisionsandcontingentliabilitiesSummaryofcontingentliabilitiesDetails</Role>
      <ShortName>Provisions and contingent liabilities - Summary of contingent liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>145</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R146.htm</HtmlFileName>
      <LongName>241214067 - Disclosure - Total revenue and income - Disaggregation of revenue by major service lines (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/TotalrevenueandincomeDisaggregationofrevenuebymajorservicelinesDetails</Role>
      <ShortName>Total revenue and income - Disaggregation of revenue by major service lines (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>146</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R147.htm</HtmlFileName>
      <LongName>241224068 - Disclosure - Total revenue and income - Summary of net income from financial instruments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/TotalrevenueandincomeSummaryofnetincomefromfinancialinstrumentsDetails</Role>
      <ShortName>Total revenue and income - Summary of net income from financial instruments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>147</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R148.htm</HtmlFileName>
      <LongName>241234069 - Disclosure - Total revenue and income - Summary of disaggregation by geographic location (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/TotalrevenueandincomeSummaryofdisaggregationbygeographiclocationDetails</Role>
      <ShortName>Total revenue and income - Summary of disaggregation by geographic location (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>148</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R149.htm</HtmlFileName>
      <LongName>241264070 - Disclosure - Operating costs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/OperatingcostsDetails</Role>
      <ShortName>Operating costs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/OperatingcostsTables</ParentRole>
      <Position>149</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R150.htm</HtmlFileName>
      <LongName>241294071 - Disclosure - Operating expenses by nature (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/OperatingexpensesbynatureDetails</Role>
      <ShortName>Operating expenses by nature (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/OperatingexpensesbynatureTables</ParentRole>
      <Position>150</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R151.htm</HtmlFileName>
      <LongName>241324072 - Disclosure - Other operating income, net (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/OtheroperatingincomenetDetails</Role>
      <ShortName>Other operating income, net (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/OtheroperatingincomenetTables</ParentRole>
      <Position>151</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R152.htm</HtmlFileName>
      <LongName>241354073 - Disclosure - Share-based plan - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SharebasedplanAdditionalinformationDetails</Role>
      <ShortName>Share-based plan - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>152</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R153.htm</HtmlFileName>
      <LongName>241364074 - Disclosure - Share-based plan - Activity of RSUs and PSUs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SharebasedplanActivityofRSUsandPSUsDetails</Role>
      <ShortName>Share-based plan - Activity of RSUs and PSUs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>153</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R154.htm</HtmlFileName>
      <LongName>241394075 - Disclosure - Earnings per share (basic and diluted) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/EarningspersharebasicanddilutedDetails</Role>
      <ShortName>Earnings per share (basic and diluted) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/EarningspersharebasicanddilutedTables</ParentRole>
      <Position>154</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R155.htm</HtmlFileName>
      <LongName>241424076 - Disclosure - Determination of fair value (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/DeterminationoffairvalueDetails</Role>
      <ShortName>Determination of fair value (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/DeterminationoffairvalueTables</ParentRole>
      <Position>155</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R156.htm</HtmlFileName>
      <LongName>241454077 - Disclosure - Management of financial risks and financial instruments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ManagementoffinancialrisksandfinancialinstrumentsDetails</Role>
      <ShortName>Management of financial risks and financial instruments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/ManagementoffinancialrisksandfinancialinstrumentsTables</ParentRole>
      <Position>156</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R157.htm</HtmlFileName>
      <LongName>241464078 - Disclosure - Management of financial risks and financial instruments - Summary of financial liabilities into groupings based on their contractual maturities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ManagementoffinancialrisksandfinancialinstrumentsSummaryoffinancialliabilitiesintogroupingsbasedontheircontractualmaturitiesDetails</Role>
      <ShortName>Management of financial risks and financial instruments - Summary of financial liabilities into groupings based on their contractual maturities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>157</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R158.htm</HtmlFileName>
      <LongName>241474079 - Disclosure - Management of financial risks and financial instruments - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ManagementoffinancialrisksandfinancialinstrumentsAdditionalinformationDetails</Role>
      <ShortName>Management of financial risks and financial instruments - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>158</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R159.htm</HtmlFileName>
      <LongName>241484080 - Disclosure - Management of financial risks and financial instruments - Summary of sensitivity analysis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/ManagementoffinancialrisksandfinancialinstrumentsSummaryofsensitivityanalysisDetails</Role>
      <ShortName>Management of financial risks and financial instruments - Summary of sensitivity analysis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>159</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R160.htm</HtmlFileName>
      <LongName>241514081 - Disclosure - Capital management - Summary of net debt and corresponding gearing ratios (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/CapitalmanagementSummaryofnetdebtandcorrespondinggearingratiosDetails</Role>
      <ShortName>Capital management - Summary of net debt and corresponding gearing ratios (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>160</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R161.htm</HtmlFileName>
      <LongName>241524082 - Disclosure - Capital management - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/CapitalmanagementAdditionalinformationDetails</Role>
      <ShortName>Capital management - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>161</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R162.htm</HtmlFileName>
      <LongName>241554083 - Disclosure - Cash flow information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/CashflowinformationDetails</Role>
      <ShortName>Cash flow information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/CashflowinformationTables</ParentRole>
      <Position>162</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R163.htm</HtmlFileName>
      <LongName>241564084 - Disclosure - Cash flow information - Additional information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/CashflowinformationAdditionalinformationDetails</Role>
      <ShortName>Cash flow information - Additional information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>163</Position>
    </Report>
    <Report instance="xp-20211231.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R164.htm</HtmlFileName>
      <LongName>241584085 - Disclosure - Subsequent events (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xpinc.com/role/SubsequenteventsDetails</Role>
      <ShortName>Subsequent events (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://xpinc.com/role/Subsequentevents</ParentRole>
      <Position>164</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="20-F" original="xp-20211231.htm">xp-20211231.htm</File>
    <File>exhibit0201_descriptionofs.htm</File>
    <File>exhibit0301_amendedandrest.htm</File>
    <File>exhibit0401_amendedandrest.htm</File>
    <File>exhibit1201_sectio302ofceo.htm</File>
    <File>exhibit1202_sectio302ofcfo.htm</File>
    <File>exhibit1301_sectio1350ofce.htm</File>
    <File>exhibit1302_sectio1350ofcf.htm</File>
    <File>exhibit2101_listofsubsidia.htm</File>
    <File>exhibit231_consentxp2021.htm</File>
    <File>xp-20211231.xsd</File>
    <File>xp-20211231_cal.xml</File>
    <File>xp-20211231_def.xml</File>
    <File>xp-20211231_lab.xml</File>
    <File>xp-20211231_pre.xml</File>
  </InputFiles>
  <SupplementalFiles>
    <File>xp-20211231_g1.jpg</File>
    <File>xp-20211231_g10.jpg</File>
    <File>xp-20211231_g11.jpg</File>
    <File>xp-20211231_g12.jpg</File>
    <File>xp-20211231_g13.jpg</File>
    <File>xp-20211231_g14.jpg</File>
    <File>xp-20211231_g15.jpg</File>
    <File>xp-20211231_g16.jpg</File>
    <File>xp-20211231_g17.jpg</File>
    <File>xp-20211231_g18.jpg</File>
    <File>xp-20211231_g19.jpg</File>
    <File>xp-20211231_g2.jpg</File>
    <File>xp-20211231_g20.jpg</File>
    <File>xp-20211231_g21.jpg</File>
    <File>xp-20211231_g22.jpg</File>
    <File>xp-20211231_g23.jpg</File>
    <File>xp-20211231_g3.jpg</File>
    <File>xp-20211231_g4.jpg</File>
    <File>xp-20211231_g5.jpg</File>
    <File>xp-20211231_g6.jpg</File>
    <File>xp-20211231_g7.jpg</File>
    <File>xp-20211231_g8.jpg</File>
    <File>xp-20211231_g9.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy items="2532">http://xbrl.ifrs.org/taxonomy/2021-03-24/ifrs-full</BaseTaxonomy>
    <BaseTaxonomy items="44">http://xbrl.sec.gov/dei/2021q4</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
