<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.26.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>1928</ContextCount>
  <ElementCount>883</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>true</FootnotesReported>
  <SegmentCount>531</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>24</UnitCount>
  <MyReports>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>1001 - Document - Cover Page</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/CoverPage</Role>
      <ShortName>Cover Page</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>1002 - Statement - Consolidated statements of financial position</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ConsolidatedStatementsOfFinancialPosition</Role>
      <ShortName>Consolidated statements of financial position</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>1003 - Statement - Consolidated statements of comprehensive income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ConsolidatedStatementsOfComprehensiveIncome</Role>
      <ShortName>Consolidated statements of comprehensive income</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1004 - Statement - Consolidated statements of changes in shareholders' equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ConsolidatedStatementsOfChangesInShareholdersEquity</Role>
      <ShortName>Consolidated statements of changes in shareholders' equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1005 - Statement - Consolidated statements of changes in shareholders' equity (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ConsolidatedStatementsOfChangesInShareholdersEquityParenthetical</Role>
      <ShortName>Consolidated statements of changes in shareholders' equity (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1006 - Statement - Consolidated statements of cash flow</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ConsolidatedStatementsOfCashFlow</Role>
      <ShortName>Consolidated statements of cash flow</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>1007 - Statement - Consolidated statements of cash flows (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ConsolidatedStatementsOfCashFlowsParenthetical</Role>
      <ShortName>Consolidated statements of cash flows (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>995447 - Disclosure - Insider Trading Policies and Procedures</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/ecd/role/InsiderTradingPoliciesProc</Role>
      <ShortName>Insider Trading Policies and Procedures</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>995550 - Disclosure - Cybersecurity Risk Management and Strategy Disclosure</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://xbrl.sec.gov/cyd/role/CybersecurityRiskManagementAndStrategyDisclosure</Role>
      <ShortName>Cybersecurity Risk Management and Strategy Disclosure</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>999001 - Disclosure - General Information, Structure and Organization of the Group's Business</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/GeneralInformationStructureAndOrganizationOfTheGroupSBusiness</Role>
      <ShortName>General Information, Structure and Organization of the Group's Business</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>999003 - Disclosure - Basis of Preparation of the Consolidated Financial Statements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BasisOfPreparationOfTheConsolidatedFinancialStatements</Role>
      <ShortName>Basis of Preparation of the Consolidated Financial Statements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>999004 - Disclosure - Acquisitions and Disposals</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AcquisitionsAndDisposals</Role>
      <ShortName>Acquisitions and Disposals</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>999005 - Disclosure - Financial Risk Management</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialRiskManagement</Role>
      <ShortName>Financial Risk Management</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>999006 - Disclosure - Business Segment Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BusinessSegmentInformation</Role>
      <ShortName>Business Segment Information</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>999007 - Disclosure - Financial Instruments by Category</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialInstrumentsByCategory</Role>
      <ShortName>Financial Instruments by Category</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>999008 - Disclosure - Intangible Assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IntangibleAssets</Role>
      <ShortName>Intangible Assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>999009 - Disclosure - Property, Plant and Equipment</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/PropertyPlantAndEquipment</Role>
      <ShortName>Property, Plant and Equipment</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>999010 - Disclosure - Right-of-use Assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RightOfUseAssets</Role>
      <ShortName>Right-of-use Assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>999011 - Disclosure - Investments in Associates and Joint Ventures</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInAssociatesAndJointVentures</Role>
      <ShortName>Investments in Associates and Joint Ventures</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>999012 - Disclosure - Assets Held For Sale and Associated Liabilities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AssetsHeldForSaleAndAssociatedLiabilities</Role>
      <ShortName>Assets Held For Sale and Associated Liabilities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>999013 - Disclosure - Inventories</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/Inventories</Role>
      <ShortName>Inventories</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>999014 - Disclosure - Other Receivables</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/OtherReceivables</Role>
      <ShortName>Other Receivables</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>999015 - Disclosure - Trade Receivables</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/TradeReceivables</Role>
      <ShortName>Trade Receivables</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>999016 - Disclosure - Investments in Financial Assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInFinancialAssets</Role>
      <ShortName>Investments in Financial Assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>24</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>999017 - Disclosure - Cash and Cash Equivalents</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/CashAndCashEquivalents</Role>
      <ShortName>Cash and Cash Equivalents</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>25</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>999018 - Disclosure - Provisions</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/Provisions</Role>
      <ShortName>Provisions</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>26</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>999019 - Disclosure - Income Tax</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IncomeTax</Role>
      <ShortName>Income Tax</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>27</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>999020 - Disclosure - Taxes Payable</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/TaxesPayable</Role>
      <ShortName>Taxes Payable</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>28</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>999021 - Disclosure - Salaries and social security</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SalariesAndSocialSecurity</Role>
      <ShortName>Salaries and social security</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>29</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>999022 - Disclosure - Lease liabilities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LeaseLiabilities</Role>
      <ShortName>Lease liabilities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>999023 - Disclosure - Loans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/Loans</Role>
      <ShortName>Loans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>999024 - Disclosure - Other Liabilities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/OtherLiabilities</Role>
      <ShortName>Other Liabilities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>999025 - Disclosure - Accounts payable</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AccountsPayable</Role>
      <ShortName>Accounts payable</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>999026 - Disclosure - Revenues</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/Revenues</Role>
      <ShortName>Revenues</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>999027 - Disclosure - Costs</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/Costs</Role>
      <ShortName>Costs</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>999028 - Disclosure - Expenses by Nature</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ExpensesByNature</Role>
      <ShortName>Expenses by Nature</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>999029 - Disclosure - Other Net Operating Results</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/OtherNetOperatingResults</Role>
      <ShortName>Other Net Operating Results</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>999030 - Disclosure - Net Financial Results</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/NetFinancialResults</Role>
      <ShortName>Net Financial Results</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>999031 - Disclosure - Investments in Joint Operations and Consortiums</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInJointOperationsAndConsortiums</Role>
      <ShortName>Investments in Joint Operations and Consortiums</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>999032 - Disclosure - Shareholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ShareholdersEquity</Role>
      <ShortName>Shareholders' Equity</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>999033 - Disclosure - Earnings Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EarningsPerShare</Role>
      <ShortName>Earnings Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>999034 - Disclosure - Contingent Assets and Liabilities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ContingentAssetsAndLiabilities</Role>
      <ShortName>Contingent Assets and Liabilities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>999035 - Disclosure - Contractual Commitments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ContractualCommitments</Role>
      <ShortName>Contractual Commitments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>999036 - Disclosure - Main Regulations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/MainRegulations</Role>
      <ShortName>Main Regulations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>999037 - Disclosure - Balances and Transactions with Related Parties</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BalancesAndTransactionsWithRelatedParties</Role>
      <ShortName>Balances and Transactions with Related Parties</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>999038 - Disclosure - Employee Benefit Plans and Similar Obligations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EmployeeBenefitPlansAndSimilarObligations</Role>
      <ShortName>Employee Benefit Plans and Similar Obligations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>999039 - Disclosure - Subsequent Events</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SubsequentEvents</Role>
      <ShortName>Subsequent Events</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>999040 - Disclosure - Supplemental Information on Oil and Gas Producing Activities (Unaudited)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnaudited</Role>
      <ShortName>Supplemental Information on Oil and Gas Producing Activities (Unaudited)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>999041 - Disclosure - Basis of Preparation of the Consolidated Financial Statements (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BasisOfPreparationOfTheConsolidatedFinancialStatementsPolicies</Role>
      <ShortName>Basis of Preparation of the Consolidated Financial Statements (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>999042 - Disclosure - General Information, Structure and Organization of the Business of the Group (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/GeneralInformationStructureAndOrganizationOfTheBusinessOfTheGroupTables</Role>
      <ShortName>General Information, Structure and Organization of the Business of the Group (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>999043 - Disclosure - Basis of Preparation of the Consolidated Financial Statements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BasisOfPreparationOfTheConsolidatedFinancialStatementsTables</Role>
      <ShortName>Basis of Preparation of the Consolidated Financial Statements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/BasisOfPreparationOfTheConsolidatedFinancialStatements</ParentRole>
      <Position>51</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>999044 - Disclosure - Acquisitions and Disposals (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AcquisitionsAndDisposalsTables</Role>
      <ShortName>Acquisitions and Disposals (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/AcquisitionsAndDisposals</ParentRole>
      <Position>52</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>999045 - Disclosure - Financial Risk Management (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialRiskManagementTables</Role>
      <ShortName>Financial Risk Management (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/FinancialRiskManagement</ParentRole>
      <Position>53</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>999046 - Disclosure - Business Segment Information (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BusinessSegmentInformationTables</Role>
      <ShortName>Business Segment Information (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/BusinessSegmentInformation</ParentRole>
      <Position>54</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>999047 - Disclosure - Financial Instruments by Category (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialInstrumentsByCategoryTables</Role>
      <ShortName>Financial Instruments by Category (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/FinancialInstrumentsByCategory</ParentRole>
      <Position>55</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>999048 - Disclosure - Intangible Assets (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IntangibleAssetsTables</Role>
      <ShortName>Intangible Assets (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/IntangibleAssets</ParentRole>
      <Position>56</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>999049 - Disclosure - Property, Plant and Equipment (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/PropertyPlantAndEquipmentTables</Role>
      <ShortName>Property, Plant and Equipment (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/PropertyPlantAndEquipment</ParentRole>
      <Position>57</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>999050 - Disclosure - Right-of-use Assets (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RightOfUseAssetsTables</Role>
      <ShortName>Right-of-use Assets (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/RightOfUseAssets</ParentRole>
      <Position>58</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>999051 - Disclosure - Investments in Associates and Joint Ventures (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInAssociatesAndJointVenturesTables</Role>
      <ShortName>Investments in Associates and Joint Ventures (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/InvestmentsInAssociatesAndJointVentures</ParentRole>
      <Position>59</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>999052 - Disclosure - Assets Held For Sale and Associated Liabilities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AssetsHeldForSaleAndAssociatedLiabilitiesTables</Role>
      <ShortName>Assets Held For Sale and Associated Liabilities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/AssetsHeldForSaleAndAssociatedLiabilities</ParentRole>
      <Position>60</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>999053 - Disclosure - Inventories (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InventoriesTables</Role>
      <ShortName>Inventories (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/Inventories</ParentRole>
      <Position>61</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>999054 - Disclosure - Other Receivables (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/OtherReceivablesTables</Role>
      <ShortName>Other Receivables (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/OtherReceivables</ParentRole>
      <Position>62</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>999055 - Disclosure - Trade Receivables (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/TradeReceivablesTables</Role>
      <ShortName>Trade Receivables (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/TradeReceivables</ParentRole>
      <Position>63</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>999056 - Disclosure - Investments in Financial Assets (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInFinancialAssetsTables</Role>
      <ShortName>Investments in Financial Assets (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/InvestmentsInFinancialAssets</ParentRole>
      <Position>64</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>999057 - Disclosure - Cash and Cash Equivalents (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/CashAndCashEquivalentsTables</Role>
      <ShortName>Cash and Cash Equivalents (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/CashAndCashEquivalents</ParentRole>
      <Position>65</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>999058 - Disclosure - Provisions (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ProvisionsTables</Role>
      <ShortName>Provisions (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/Provisions</ParentRole>
      <Position>66</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>999059 - Disclosure - Income Tax (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IncomeTaxTables</Role>
      <ShortName>Income Tax (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/IncomeTax</ParentRole>
      <Position>67</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>999060 - Disclosure - Taxes Payable (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/TaxesPayableTables</Role>
      <ShortName>Taxes Payable (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/TaxesPayable</ParentRole>
      <Position>68</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>999061 - Disclosure - Salaries and social security (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SalariesAndSocialSecurityTables</Role>
      <ShortName>Salaries and social security (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/SalariesAndSocialSecurity</ParentRole>
      <Position>69</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>999062 - Disclosure - Lease liabilities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LeaseLiabilitiesTables</Role>
      <ShortName>Lease liabilities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/LeaseLiabilities</ParentRole>
      <Position>70</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R71.htm</HtmlFileName>
      <LongName>999063 - Disclosure - Loans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LoansTables</Role>
      <ShortName>Loans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/Loans</ParentRole>
      <Position>71</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R72.htm</HtmlFileName>
      <LongName>999064 - Disclosure - Other Liabilities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/OtherLiabilitiesTables</Role>
      <ShortName>Other Liabilities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/OtherLiabilities</ParentRole>
      <Position>72</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R73.htm</HtmlFileName>
      <LongName>999065 - Disclosure - Accounts payable (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AccountsPayableTables</Role>
      <ShortName>Accounts payable (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/AccountsPayable</ParentRole>
      <Position>73</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R74.htm</HtmlFileName>
      <LongName>999066 - Disclosure - Revenues (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RevenuesTables</Role>
      <ShortName>Revenues (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/Revenues</ParentRole>
      <Position>74</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R75.htm</HtmlFileName>
      <LongName>999067 - Disclosure - Costs (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/CostsTables</Role>
      <ShortName>Costs (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/Costs</ParentRole>
      <Position>75</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R76.htm</HtmlFileName>
      <LongName>999068 - Disclosure - Expenses by Nature (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ExpensesByNatureTables</Role>
      <ShortName>Expenses by Nature (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/ExpensesByNature</ParentRole>
      <Position>76</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R77.htm</HtmlFileName>
      <LongName>999069 - Disclosure - Other Net Operating Results (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/OtherNetOperatingResultsTables</Role>
      <ShortName>Other Net Operating Results (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/OtherNetOperatingResults</ParentRole>
      <Position>77</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R78.htm</HtmlFileName>
      <LongName>999070 - Disclosure - Net Financial Results (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/NetFinancialResultsTables</Role>
      <ShortName>Net Financial Results (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/NetFinancialResults</ParentRole>
      <Position>78</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R79.htm</HtmlFileName>
      <LongName>999071 - Disclosure - Investments in Joint Operations and Consortiums (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInJointOperationsAndConsortiumsTables</Role>
      <ShortName>Investments in Joint Operations and Consortiums (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/InvestmentsInJointOperationsAndConsortiums</ParentRole>
      <Position>79</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R80.htm</HtmlFileName>
      <LongName>999072 - Disclosure - Earnings Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EarningsPerShareTables</Role>
      <ShortName>Earnings Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/EarningsPerShare</ParentRole>
      <Position>80</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R81.htm</HtmlFileName>
      <LongName>999073 - Disclosure - Balances and Transactions with Related Parties (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BalancesAndTransactionsWithRelatedPartiesTables</Role>
      <ShortName>Balances and Transactions with Related Parties (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/BalancesAndTransactionsWithRelatedParties</ParentRole>
      <Position>81</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R82.htm</HtmlFileName>
      <LongName>999074 - Disclosure - Employee Benefit Plans and Similar Obligations (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EmployeeBenefitPlansAndSimilarObligationsTables</Role>
      <ShortName>Employee Benefit Plans and Similar Obligations (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/EmployeeBenefitPlansAndSimilarObligations</ParentRole>
      <Position>82</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R83.htm</HtmlFileName>
      <LongName>999075 - Disclosure - Supplemental Information on Oil and Gas Producing Activities (Unaudited) (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedTables</Role>
      <ShortName>Supplemental Information on Oil and Gas Producing Activities (Unaudited) (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnaudited</ParentRole>
      <Position>83</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R84.htm</HtmlFileName>
      <LongName>999076 - Disclosure - General Information, Structure and Organization of the Business of the Group - Summary of Main Companies of the Group (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/GeneralInformationStructureAndOrganizationOfTheBusinessOfTheGroupSummaryOfMainCompaniesOfTheGroupDetail</Role>
      <ShortName>General Information, Structure and Organization of the Business of the Group - Summary of Main Companies of the Group (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>84</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R85.htm</HtmlFileName>
      <LongName>999077 - Disclosure - Basis of Preparation of the Consolidated Financial Statements - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BasisOfPreparationOfTheConsolidatedFinancialStatementsAdditionalInformationDetail</Role>
      <ShortName>Basis of Preparation of the Consolidated Financial Statements - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>85</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R86.htm</HtmlFileName>
      <LongName>999078 - Disclosure - Basis of Preparation of the Consolidated Financial Statements - Detailed Information About Property, Plant and Equipment (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BasisOfPreparationOfTheConsolidatedFinancialStatementsDetailedInformationAboutPropertyPlantAndEquipmentDetail</Role>
      <ShortName>Basis of Preparation of the Consolidated Financial Statements - Detailed Information About Property, Plant and Equipment (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>86</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R87.htm</HtmlFileName>
      <LongName>999079 - Disclosure - Acquisitions and Disposals - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AcquisitionsAndDisposalsAdditionalInformationDetail</Role>
      <ShortName>Acquisitions and Disposals - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>87</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R88.htm</HtmlFileName>
      <LongName>999080 - Disclosure - Acquisitions and Disposals - Summary Of Fair Values Of The Identifiable Assets Acquired And The Liabilities Assumed (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AcquisitionsAndDisposalsSummaryOfFairValuesOfTheIdentifiableAssetsAcquiredAndTheLiabilitiesAssumedDetail</Role>
      <ShortName>Acquisitions and Disposals - Summary Of Fair Values Of The Identifiable Assets Acquired And The Liabilities Assumed (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>88</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R89.htm</HtmlFileName>
      <LongName>999081 - Disclosure - Financial Risk Management - Schedule of Breakdown of Effect a Variation of 10% in Prevailing Exchange Rates on Net Income (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialRiskManagementScheduleOfBreakdownOfEffectAVariationOf10InPrevailingExchangeRatesOnNetIncomeDetail</Role>
      <ShortName>Financial Risk Management - Schedule of Breakdown of Effect a Variation of 10% in Prevailing Exchange Rates on Net Income (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>89</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R90.htm</HtmlFileName>
      <LongName>999082 - Disclosure - Financial Risk Management - Information about Financial Assets and Liabilities That Accrues Interest Considering Applicable Rate (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialRiskManagementInformationAboutFinancialAssetsAndLiabilitiesThatAccruesInterestConsideringApplicableRateDetail</Role>
      <ShortName>Financial Risk Management - Information about Financial Assets and Liabilities That Accrues Interest Considering Applicable Rate (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>90</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R91.htm</HtmlFileName>
      <LongName>999083 - Disclosure - Financial Risk Management - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialRiskManagementAdditionalInformationDetail</Role>
      <ShortName>Financial Risk Management - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>91</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R92.htm</HtmlFileName>
      <LongName>999084 - Disclosure - Financial Risk Management - Schedule of Estimated Impact on Consolidated Comprehensive Income that an Increase or Decrease of 100 Basis Points in Interest Rate (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialRiskManagementScheduleOfEstimatedImpactOnConsolidatedComprehensiveIncomeThatAnIncreaseOrDecreaseOf100BasisPointsInInterestRateDetail</Role>
      <ShortName>Financial Risk Management - Schedule of Estimated Impact on Consolidated Comprehensive Income that an Increase or Decrease of 100 Basis Points in Interest Rate (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>92</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R93.htm</HtmlFileName>
      <LongName>999085 - Disclosure - Financial Risk Management - Schedule of Effect of a 10% Variation in the Prices of Investments in Financial Instruments (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialRiskManagementScheduleOfEffectOfA10VariationInThePricesOfInvestmentsInFinancialInstrumentsDetail</Role>
      <ShortName>Financial Risk Management - Schedule of Effect of a 10% Variation in the Prices of Investments in Financial Instruments (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>93</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R94.htm</HtmlFileName>
      <LongName>999086 - Disclosure - Financial Risk Management - Schedule of Maturity Dates of Financial Liabilities (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialRiskManagementScheduleOfMaturityDatesOfFinancialLiabilitiesDetail</Role>
      <ShortName>Financial Risk Management - Schedule of Maturity Dates of Financial Liabilities (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>94</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R95.htm</HtmlFileName>
      <LongName>999087 - Disclosure - Financial Risk Management - Summary of Maximum Exposure to Credit Risk (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialRiskManagementSummaryOfMaximumExposureToCreditRiskDetail</Role>
      <ShortName>Financial Risk Management - Summary of Maximum Exposure to Credit Risk (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>95</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R96.htm</HtmlFileName>
      <LongName>999088 - Disclosure - Financial Risk Management - Summary of Breakdown of the Financial Assets (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialRiskManagementSummaryOfBreakdownOfTheFinancialAssetsDetail</Role>
      <ShortName>Financial Risk Management - Summary of Breakdown of the Financial Assets (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>96</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R97.htm</HtmlFileName>
      <LongName>999089 - Disclosure - Business Segment Information - Summary of Business Segment Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BusinessSegmentInformationSummaryOfBusinessSegmentInformationDetail</Role>
      <ShortName>Business Segment Information - Summary of Business Segment Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>97</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R98.htm</HtmlFileName>
      <LongName>999090 - Disclosure - Business Segment Information - Summary of Business Segment Information (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BusinessSegmentInformationSummaryOfBusinessSegmentInformationParentheticalDetail</Role>
      <ShortName>Business Segment Information - Summary of Business Segment Information (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>98</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R99.htm</HtmlFileName>
      <LongName>999091 - Disclosure - Financial Instruments by Category - Summary of Financial Assets and Liabilities by Category of Financial Instrument and Reconciliation (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialInstrumentsByCategorySummaryOfFinancialAssetsAndLiabilitiesByCategoryOfFinancialInstrumentAndReconciliationDetail</Role>
      <ShortName>Financial Instruments by Category - Summary of Financial Assets and Liabilities by Category of Financial Instrument and Reconciliation (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>99</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R100.htm</HtmlFileName>
      <LongName>999092 - Disclosure - Financial Instruments by Category - Summary of Gains and Losses on Financial Instruments (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialInstrumentsByCategorySummaryOfGainsAndLossesOnFinancialInstrumentsDetail</Role>
      <ShortName>Financial Instruments by Category - Summary of Gains and Losses on Financial Instruments (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>100</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R101.htm</HtmlFileName>
      <LongName>999093 - Disclosure - Financial Instruments by Category - Summary of Company's Financial Assets Measured at Fair Value (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialInstrumentsByCategorySummaryOfCompanysFinancialAssetsMeasuredAtFairValueDetail</Role>
      <ShortName>Financial Instruments by Category - Summary of Company's Financial Assets Measured at Fair Value (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>101</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R102.htm</HtmlFileName>
      <LongName>999094 - Disclosure - Financial Instruments by Category - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/FinancialInstrumentsByCategoryAdditionalInformationDetail</Role>
      <ShortName>Financial Instruments by Category - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>102</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R103.htm</HtmlFileName>
      <LongName>999095 - Disclosure - Intangible Assets - Schedule of Intangible Assets (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IntangibleAssetsScheduleOfIntangibleAssetsDetail</Role>
      <ShortName>Intangible Assets - Schedule of Intangible Assets (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>103</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R104.htm</HtmlFileName>
      <LongName>999096 - Disclosure - Intangible Assets - Summary of Changes in Intangible Assets (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IntangibleAssetsSummaryOfChangesInIntangibleAssetsDetail</Role>
      <ShortName>Intangible Assets - Summary of Changes in Intangible Assets (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>104</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R105.htm</HtmlFileName>
      <LongName>999097 - Disclosure - Property, Plant and Equipment - Summary of Property Plant and Equipment (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/PropertyPlantAndEquipmentSummaryOfPropertyPlantAndEquipmentDetail</Role>
      <ShortName>Property, Plant and Equipment - Summary of Property Plant and Equipment (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>105</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R106.htm</HtmlFileName>
      <LongName>999098 - Disclosure - Property Plant and Equipment - Summary of Changes in Property Plant and Equipment (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/PropertyPlantAndEquipmentSummaryOfChangesInPropertyPlantAndEquipmentDetail</Role>
      <ShortName>Property Plant and Equipment - Summary of Changes in Property Plant and Equipment (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>106</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R107.htm</HtmlFileName>
      <LongName>999099 - Disclosure - Property Plant and Equipment - Summary of Changes in Property Plant and Equipment (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/PropertyPlantAndEquipmentSummaryOfChangesInPropertyPlantAndEquipmentParentheticalDetail</Role>
      <ShortName>Property Plant and Equipment - Summary of Changes in Property Plant and Equipment (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>107</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R108.htm</HtmlFileName>
      <LongName>999100 - Disclosure - Property, Plant and Equipment - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/PropertyPlantAndEquipmentAdditionalInformationDetail</Role>
      <ShortName>Property, Plant and Equipment - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>108</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R109.htm</HtmlFileName>
      <LongName>999101 - Disclosure - Property, Plant and Equipment - Summary of Provision for Obsolescence of Materials and Equipment (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/PropertyPlantAndEquipmentSummaryOfProvisionForObsolescenceOfMaterialsAndEquipmentDetail</Role>
      <ShortName>Property, Plant and Equipment - Summary of Provision for Obsolescence of Materials and Equipment (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>109</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R110.htm</HtmlFileName>
      <LongName>999102 - Disclosure - Property, Plant and Equipment - Summary of Provisions for Impairment of Property, Plant and Equipment (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/PropertyPlantAndEquipmentSummaryOfProvisionsForImpairmentOfPropertyPlantAndEquipmentDetail</Role>
      <ShortName>Property, Plant and Equipment - Summary of Provisions for Impairment of Property, Plant and Equipment (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>110</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R111.htm</HtmlFileName>
      <LongName>999103 - Disclosure - Property, Plant and Equipment - Summary of Provisions for Impairment of Property, Plant and Equipment (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/PropertyPlantAndEquipmentSummaryOfProvisionsForImpairmentOfPropertyPlantAndEquipmentParentheticalDetail</Role>
      <ShortName>Property, Plant and Equipment - Summary of Provisions for Impairment of Property, Plant and Equipment (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>111</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R112.htm</HtmlFileName>
      <LongName>999104 - Disclosure - Property, Plant and Equipment - Summary of Property, Plant and Equipment by Geographic Area (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/PropertyPlantAndEquipmentSummaryOfPropertyPlantAndEquipmentByGeographicAreaDetail</Role>
      <ShortName>Property, Plant and Equipment - Summary of Property, Plant and Equipment by Geographic Area (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>112</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R113.htm</HtmlFileName>
      <LongName>999105 - Disclosure - Right-of-use Assets - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RightOfUseAssetsAdditionalInformationDetail</Role>
      <ShortName>Right-of-use Assets - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>113</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R114.htm</HtmlFileName>
      <LongName>999106 - Disclosure - Right-of-use Assets - Summary of Evolution of the Group's Right-of-use Assets (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RightOfUseAssetsSummaryOfEvolutionOfTheGroupsRightOfUseAssetsDetail</Role>
      <ShortName>Right-of-use Assets - Summary of Evolution of the Group's Right-of-use Assets (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>114</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R115.htm</HtmlFileName>
      <LongName>999107 - Disclosure - Right-of-use Assets -Summary of Evolution of the Group's Right-of-use Assets (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RightOfUseAssetsSummaryOfEvolutionOfTheGroupsRightOfUseAssetsParentheticalDetail</Role>
      <ShortName>Right-of-use Assets -Summary of Evolution of the Group's Right-of-use Assets (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>115</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R116.htm</HtmlFileName>
      <LongName>999108 - Disclosure - Investments in Associates and Joint Ventures - Summary of Investments in Associates and Joint Ventures at an Aggregate Level (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInAssociatesAndJointVenturesSummaryOfInvestmentsInAssociatesAndJointVenturesAtAnAggregateLevelDetail</Role>
      <ShortName>Investments in Associates and Joint Ventures - Summary of Investments in Associates and Joint Ventures at an Aggregate Level (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>116</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R117.htm</HtmlFileName>
      <LongName>999109 - Disclosure - Investments in Associates and Joint Ventures - Summary of Movements Which Affected the Value of the Investments in associates and joint ventures (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInAssociatesAndJointVenturesSummaryOfMovementsWhichAffectedTheValueOfTheInvestmentsInAssociatesAndJointVenturesDetail</Role>
      <ShortName>Investments in Associates and Joint Ventures - Summary of Movements Which Affected the Value of the Investments in associates and joint ventures (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>117</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R118.htm</HtmlFileName>
      <LongName>999110 - Disclosure - Investments in Associates and Joint Ventures - Summary of Income from Equity Interests in Associates and Joint Ventures (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInAssociatesAndJointVenturesSummaryOfIncomeFromEquityInterestsInAssociatesAndJointVenturesDetail</Role>
      <ShortName>Investments in Associates and Joint Ventures - Summary of Income from Equity Interests in Associates and Joint Ventures (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>118</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R119.htm</HtmlFileName>
      <LongName>999111 - Disclosure - Investments in Associates and Joint Ventures - Summary of analysis of assets and liabilities of significant associates and joint ventures (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInAssociatesAndJointVenturesSummaryOfAnalysisOfAssetsAndLiabilitiesOfSignificantAssociatesAndJointVenturesDetail</Role>
      <ShortName>Investments in Associates and Joint Ventures - Summary of analysis of assets and liabilities of significant associates and joint ventures (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>119</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R120.htm</HtmlFileName>
      <LongName>999112 - Disclosure - Investments in Associates and Joint Ventures  - Summary of the investments in associates and joint ventures on a disaggregated basis (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInAssociatesAndJointVenturesSummaryOfTheInvestmentsInAssociatesAndJointVenturesOnADisaggregatedBasisDetail</Role>
      <ShortName>Investments in Associates and Joint Ventures  - Summary of the investments in associates and joint ventures on a disaggregated basis (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>120</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R121.htm</HtmlFileName>
      <LongName>999113 - Disclosure - Assets Held for Sale and Associated Liabilities - Summary of the Main Assets Held For Sale and Associated Liabilities (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AssetsHeldForSaleAndAssociatedLiabilitiesSummaryOfTheMainAssetsHeldForSaleAndAssociatedLiabilitiesDetail</Role>
      <ShortName>Assets Held for Sale and Associated Liabilities - Summary of the Main Assets Held For Sale and Associated Liabilities (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>121</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R122.htm</HtmlFileName>
      <LongName>999114 - Disclosure - Assets Held for Sale and Associated Liabilities - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AssetsHeldForSaleAndAssociatedLiabilitiesAdditionalInformationDetail</Role>
      <ShortName>Assets Held for Sale and Associated Liabilities - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>122</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R123.htm</HtmlFileName>
      <LongName>999115 - Disclosure - Inventories - Summary of Inventories (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InventoriesSummaryOfInventoriesDetail</Role>
      <ShortName>Inventories - Summary of Inventories (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>123</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R124.htm</HtmlFileName>
      <LongName>999116 - Disclosure - Inventories - Summary of Inventories (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InventoriesSummaryOfInventoriesParentheticalDetail</Role>
      <ShortName>Inventories - Summary of Inventories (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>124</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R125.htm</HtmlFileName>
      <LongName>999117 - Disclosure - Other Receivables - Summary of Other Receivables (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/OtherReceivablesSummaryOfOtherReceivablesDetail</Role>
      <ShortName>Other Receivables - Summary of Other Receivables (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>125</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R126.htm</HtmlFileName>
      <LongName>999118 - Disclosure - Trade Receivables - Summary of Trade Receivables (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/TradeReceivablesSummaryOfTradeReceivablesDetail</Role>
      <ShortName>Trade Receivables - Summary of Trade Receivables (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>126</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R127.htm</HtmlFileName>
      <LongName>999119 - Disclosure - Trade Receivables - Summary of Evolution of the Provision for Doubtful Trade Receivables (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/TradeReceivablesSummaryOfEvolutionOfTheProvisionForDoubtfulTradeReceivablesDetail</Role>
      <ShortName>Trade Receivables - Summary of Evolution of the Provision for Doubtful Trade Receivables (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>127</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R128.htm</HtmlFileName>
      <LongName>999120 - Disclosure - Investments in Financial Assets - Summary of Investments in Financial Assets (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInFinancialAssetsSummaryOfInvestmentsInFinancialAssetsDetail</Role>
      <ShortName>Investments in Financial Assets - Summary of Investments in Financial Assets (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>128</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R129.htm</HtmlFileName>
      <LongName>999121 - Disclosure - Cash and Cash Equivalents - Summary of Cash and Cash Equivalents (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/CashAndCashEquivalentsSummaryOfCashAndCashEquivalentsDetail</Role>
      <ShortName>Cash and Cash Equivalents - Summary of Cash and Cash Equivalents (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>129</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R130.htm</HtmlFileName>
      <LongName>999122 - Disclosure - Cash and Cash Equivalents - Summary of Cash and Cash Equivalents (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/CashAndCashEquivalentsSummaryOfCashAndCashEquivalentsParentheticalDetail</Role>
      <ShortName>Cash and Cash Equivalents - Summary of Cash and Cash Equivalents (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>130</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R131.htm</HtmlFileName>
      <LongName>999123 - Disclosure - Provisions - Summary of Changes in Group's Provisions (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ProvisionsSummaryOfChangesInGroupsProvisionsDetail</Role>
      <ShortName>Provisions - Summary of Changes in Group's Provisions (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>131</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R132.htm</HtmlFileName>
      <LongName>999124 - Disclosure - Provisions - Summary of Changes in Group's Provisions (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ProvisionsSummaryOfChangesInGroupsProvisionsParentheticalDetail</Role>
      <ShortName>Provisions - Summary of Changes in Group's Provisions (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>132</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R133.htm</HtmlFileName>
      <LongName>999125 - Disclosure - Provisions - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ProvisionsAdditionalInformationDetail</Role>
      <ShortName>Provisions - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>133</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R134.htm</HtmlFileName>
      <LongName>999126 - Disclosure - Income Tax - Summary of Calculation of Income Tax Expense Accrued (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IncomeTaxSummaryOfCalculationOfIncomeTaxExpenseAccruedDetail</Role>
      <ShortName>Income Tax - Summary of Calculation of Income Tax Expense Accrued (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>134</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R135.htm</HtmlFileName>
      <LongName>999127 - Disclosure - Income Tax - Summary of Reconciliation between the Charge to Net Income for Income Tax and the One that would Result from Applying the Prevailing Tax Rate on Net Income Before Income Tax Arising from the Consolidated Statements of Comprehensive Income (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IncomeTaxSummaryOfReconciliationBetweenTheChargeToNetIncomeForIncomeTaxAndTheOneThatWouldResultFromApplyingThePrevailingTaxRateOnNetIncomeBeforeIncomeTaxArisingFromTheConsolidatedStatementsOfComprehensiveIncoe8f94</Role>
      <ShortName>Income Tax - Summary of Reconciliation between the Charge to Net Income for Income Tax and the One that would Result from Applying the Prevailing Tax Rate on Net Income Before Income Tax Arising from the Consolidated Statements of Comprehensive Income (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>135</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R136.htm</HtmlFileName>
      <LongName>999128 - Disclosure - Income Tax - Summary of Breakdown of Income Tax Liability (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IncomeTaxSummaryOfBreakdownOfIncomeTaxLiabilityDetail</Role>
      <ShortName>Income Tax - Summary of Breakdown of Income Tax Liability (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>136</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R137.htm</HtmlFileName>
      <LongName>999129 - Disclosure - Income Tax - Summary of Breakdown of Income Tax Liability (Parentheticals) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IncomeTaxSummaryOfBreakdownOfIncomeTaxLiabilityParentheticalsDetail</Role>
      <ShortName>Income Tax - Summary of Breakdown of Income Tax Liability (Parentheticals) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>137</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R138.htm</HtmlFileName>
      <LongName>999130 - Disclosure - Income Tax - Summary of Breakdown of Deferred Tax (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IncomeTaxSummaryOfBreakdownOfDeferredTaxDetail</Role>
      <ShortName>Income Tax - Summary of Breakdown of Deferred Tax (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>138</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R139.htm</HtmlFileName>
      <LongName>999131 - Disclosure - Income Tax - Summary of Breakdown of Deferred Tax (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IncomeTaxSummaryOfBreakdownOfDeferredTaxParentheticalDetail</Role>
      <ShortName>Income Tax - Summary of Breakdown of Deferred Tax (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>139</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R140.htm</HtmlFileName>
      <LongName>999132 - Disclosure - Income Tax - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/IncomeTaxAdditionalInformationDetail</Role>
      <ShortName>Income Tax - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>140</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R141.htm</HtmlFileName>
      <LongName>999133 - Disclosure - Taxes Payable - Summary of taxes payable (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/TaxesPayableSummaryOfTaxesPayableDetail</Role>
      <ShortName>Taxes Payable - Summary of taxes payable (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>141</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R142.htm</HtmlFileName>
      <LongName>999134 - Disclosure - Salaries and social security - Summary of detailed information about salaries and social security (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SalariesAndSocialSecuritySummaryOfDetailedInformationAboutSalariesAndSocialSecurityDetail</Role>
      <ShortName>Salaries and social security - Summary of detailed information about salaries and social security (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>142</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R143.htm</HtmlFileName>
      <LongName>999135 - Disclosure - Lease liabilities - Summary of Lease Libilities (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LeaseLiabilitiesSummaryOfLeaseLibilitiesDetail</Role>
      <ShortName>Lease liabilities - Summary of Lease Libilities (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>143</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R144.htm</HtmlFileName>
      <LongName>999136 - Disclosure - Lease liabilities - Summary of lease liabilities and discount rates (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LeaseLiabilitiesSummaryOfLeaseLiabilitiesAndDiscountRatesDetail</Role>
      <ShortName>Lease liabilities - Summary of lease liabilities and discount rates (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>144</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R145.htm</HtmlFileName>
      <LongName>999137 - Disclosure - Lease liabilities - Additional information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LeaseLiabilitiesAdditionalInformationDetail</Role>
      <ShortName>Lease liabilities - Additional information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>145</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R146.htm</HtmlFileName>
      <LongName>999138 - Disclosure - Lease liabilities - Summary of lease liabilities activity (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LeaseLiabilitiesSummaryOfLeaseLiabilitiesActivityDetail</Role>
      <ShortName>Lease liabilities - Summary of lease liabilities activity (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>146</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R147.htm</HtmlFileName>
      <LongName>999139 - Disclosure - Loans - Schedule of Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LoansScheduleOfLoansDetail</Role>
      <ShortName>Loans - Schedule of Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>147</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R148.htm</HtmlFileName>
      <LongName>999140 - Disclosure - Loans - Schedule of Loans (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LoansScheduleOfLoansParentheticalDetail</Role>
      <ShortName>Loans - Schedule of Loans (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>148</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R149.htm</HtmlFileName>
      <LongName>999141 - Disclosure - Loans - Evolution of the Loans (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LoansEvolutionOfTheLoansDetail</Role>
      <ShortName>Loans - Evolution of the Loans (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>149</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R150.htm</HtmlFileName>
      <LongName>999142 - Disclosure - Loans - Details of Negotiable Obligations (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LoansDetailsOfNegotiableObligationsDetail</Role>
      <ShortName>Loans - Details of Negotiable Obligations (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>150</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R151.htm</HtmlFileName>
      <LongName>999143 - Disclosure - Loans - Details of Negotiable Obligations (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/LoansDetailsOfNegotiableObligationsParentheticalDetail</Role>
      <ShortName>Loans - Details of Negotiable Obligations (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>151</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R152.htm</HtmlFileName>
      <LongName>999144 - Disclosure - Other Liabilities - Details of Other Liabilities (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/OtherLiabilitiesDetailsOfOtherLiabilitiesDetail</Role>
      <ShortName>Other Liabilities - Details of Other Liabilities (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>152</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R153.htm</HtmlFileName>
      <LongName>999145 - Disclosure - Accounts payable - Detailed Information about Accounts Payable (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/AccountsPayableDetailedInformationAboutAccountsPayableDetail</Role>
      <ShortName>Accounts payable - Detailed Information about Accounts Payable (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>153</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R154.htm</HtmlFileName>
      <LongName>999146 - Disclosure - Revenues - Detailed Information about Revenue (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RevenuesDetailedInformationAboutRevenueDetail</Role>
      <ShortName>Revenues - Detailed Information about Revenue (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>154</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R155.htm</HtmlFileName>
      <LongName>999147 - Disclosure - Revenues - Summary of Breakdown of Revenues by Type of Good or Service (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RevenuesSummaryOfBreakdownOfRevenuesByTypeOfGoodOrServiceDetail</Role>
      <ShortName>Revenues - Summary of Breakdown of Revenues by Type of Good or Service (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>155</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R156.htm</HtmlFileName>
      <LongName>999148 - Disclosure - Revenues - Summary of Breakdown of Revenues by Type of Good or Service (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RevenuesSummaryOfBreakdownOfRevenuesByTypeOfGoodOrServiceParentheticalDetail</Role>
      <ShortName>Revenues - Summary of Breakdown of Revenues by Type of Good or Service (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>156</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R157.htm</HtmlFileName>
      <LongName>999149 - Disclosure - Revenues - Summary of Breakdown of Revenues by Sales Channels (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RevenuesSummaryOfBreakdownOfRevenuesBySalesChannelsDetail</Role>
      <ShortName>Revenues - Summary of Breakdown of Revenues by Sales Channels (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>157</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R158.htm</HtmlFileName>
      <LongName>999150 - Disclosure - Revenues - Summary of Revenue by Geographic Area (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RevenuesSummaryOfRevenueByGeographicAreaDetail</Role>
      <ShortName>Revenues - Summary of Revenue by Geographic Area (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>158</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R159.htm</HtmlFileName>
      <LongName>999151 - Disclosure - Revenues - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RevenuesAdditionalInformationDetail</Role>
      <ShortName>Revenues - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>159</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R160.htm</HtmlFileName>
      <LongName>999152 - Disclosure - Revenues - Summary of Credits, Contract Assets and Contract Liabilities (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/RevenuesSummaryOfCreditsContractAssetsAndContractLiabilitiesDetail</Role>
      <ShortName>Revenues - Summary of Credits, Contract Assets and Contract Liabilities (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>160</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R161.htm</HtmlFileName>
      <LongName>999153 - Disclosure - Costs - Detailed Information of Inventory Costs (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/CostsDetailedInformationOfInventoryCostsDetail</Role>
      <ShortName>Costs - Detailed Information of Inventory Costs (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>161</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R162.htm</HtmlFileName>
      <LongName>999154 - Disclosure - Expenses by Nature - Detailed Information about Expenses by Nature (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ExpensesByNatureDetailedInformationAboutExpensesByNatureDetail</Role>
      <ShortName>Expenses by Nature - Detailed Information about Expenses by Nature (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>162</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R163.htm</HtmlFileName>
      <LongName>999155 - Disclosure - Expenses by Nature - Detailed Information about Expenses by Nature (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ExpensesByNatureDetailedInformationAboutExpensesByNatureParentheticalDetail</Role>
      <ShortName>Expenses by Nature - Detailed Information about Expenses by Nature (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>163</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R164.htm</HtmlFileName>
      <LongName>999156 - Disclosure - Other Net Operating Results (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/OtherNetOperatingResultsDetail</Role>
      <ShortName>Other Net Operating Results (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.ypf.com/role/OtherNetOperatingResultsTables</ParentRole>
      <Position>164</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R165.htm</HtmlFileName>
      <LongName>999157 - Disclosure - Net Financial Results - Detailed Information about Financial Results (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/NetFinancialResultsDetailedInformationAboutFinancialResultsDetail</Role>
      <ShortName>Net Financial Results - Detailed Information about Financial Results (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>165</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R166.htm</HtmlFileName>
      <LongName>999158 - Disclosure - Net Financial Results - Detailed Information about Financial Results (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/NetFinancialResultsDetailedInformationAboutFinancialResultsParentheticalDetail</Role>
      <ShortName>Net Financial Results - Detailed Information about Financial Results (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>166</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R167.htm</HtmlFileName>
      <LongName>999159 - Disclosure - Investments in Joint Operations and Consortiums - Information of Assets and Liabilities (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInJointOperationsAndConsortiumsInformationOfAssetsAndLiabilitiesDetail</Role>
      <ShortName>Investments in Joint Operations and Consortiums - Information of Assets and Liabilities (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>167</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R168.htm</HtmlFileName>
      <LongName>999160 - Disclosure - Investments in Joint Operations and Consortiums - Information about Exploration and Exploitation of Joint Ventures and Other Agreements (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/InvestmentsInJointOperationsAndConsortiumsInformationAboutExplorationAndExploitationOfJointVenturesAndOtherAgreementsDetail</Role>
      <ShortName>Investments in Joint Operations and Consortiums - Information about Exploration and Exploitation of Joint Ventures and Other Agreements (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>168</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R169.htm</HtmlFileName>
      <LongName>999161 - Disclosure - Shareholders' Equity - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ShareholdersEquityAdditionalInformationDetail</Role>
      <ShortName>Shareholders' Equity - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>169</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R170.htm</HtmlFileName>
      <LongName>999162 - Disclosure - Earnings Per Share - Summary of Earnings Per Share (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EarningsPerShareSummaryOfEarningsPerShareDetail</Role>
      <ShortName>Earnings Per Share - Summary of Earnings Per Share (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>170</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R171.htm</HtmlFileName>
      <LongName>999163 - Disclosure - Contingent Assets and Liabilities - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ContingentAssetsAndLiabilitiesAdditionalInformationDetail</Role>
      <ShortName>Contingent Assets and Liabilities - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>171</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R172.htm</HtmlFileName>
      <LongName>999164 - Disclosure - Contractual Commitments - Contractual Commitments - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ContractualCommitmentsContractualCommitmentsAdditionalInformationDetail</Role>
      <ShortName>Contractual Commitments - Contractual Commitments - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>172</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R173.htm</HtmlFileName>
      <LongName>999165 - Disclosure - Contractual Commitments - Granted Guarantees - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/ContractualCommitmentsGrantedGuaranteesAdditionalInformationDetail</Role>
      <ShortName>Contractual Commitments - Granted Guarantees - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>173</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R174.htm</HtmlFileName>
      <LongName>999166 - Disclosure - Main Regulations - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/MainRegulationsAdditionalInformationDetail</Role>
      <ShortName>Main Regulations - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>174</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R175.htm</HtmlFileName>
      <LongName>999167 - Disclosure - Main Regulations - Additional Information (Detail 1)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/MainRegulationsAdditionalInformationDetail1</Role>
      <ShortName>Main Regulations - Additional Information (Detail 1)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>175</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R176.htm</HtmlFileName>
      <LongName>999168 - Disclosure - Balances and Transactions with Related Parties - Information Detailed in the Tables below Shows the Balances with Associates and Joint Ventures (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BalancesAndTransactionsWithRelatedPartiesInformationDetailedInTheTablesBelowShowsTheBalancesWithAssociatesAndJointVenturesDetail</Role>
      <ShortName>Balances and Transactions with Related Parties - Information Detailed in the Tables below Shows the Balances with Associates and Joint Ventures (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>176</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R177.htm</HtmlFileName>
      <LongName>999169 - Disclosure - Balances and Transactions with Related Parties - Information about Related Party (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BalancesAndTransactionsWithRelatedPartiesInformationAboutRelatedPartyDetail</Role>
      <ShortName>Balances and Transactions with Related Parties - Information about Related Party (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>177</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R178.htm</HtmlFileName>
      <LongName>999170 - Disclosure - Balances and Transactions with Related Parties - Summary of Compensation of Key Management Personnel (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BalancesAndTransactionsWithRelatedPartiesSummaryOfCompensationOfKeyManagementPersonnelDetail</Role>
      <ShortName>Balances and Transactions with Related Parties - Summary of Compensation of Key Management Personnel (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>178</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R179.htm</HtmlFileName>
      <LongName>999171 - Disclosure - Balances and Transactions with Related Parties - Summary of Compensation of Key Management Personnel (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BalancesAndTransactionsWithRelatedPartiesSummaryOfCompensationOfKeyManagementPersonnelParentheticalDetail</Role>
      <ShortName>Balances and Transactions with Related Parties - Summary of Compensation of Key Management Personnel (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>179</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R180.htm</HtmlFileName>
      <LongName>999172 - Disclosure - Balances and Transactions with Related Parties - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/BalancesAndTransactionsWithRelatedPartiesAdditionalInformationDetail</Role>
      <ShortName>Balances and Transactions with Related Parties - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>180</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R181.htm</HtmlFileName>
      <LongName>999173 - Disclosure - Employee Benefit Plans and Similar Obligations - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EmployeeBenefitPlansAndSimilarObligationsAdditionalInformationDetail</Role>
      <ShortName>Employee Benefit Plans and Similar Obligations - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>181</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R182.htm</HtmlFileName>
      <LongName>999174 - Disclosure - Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2020-2023) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EmployeeBenefitPlansAndSimilarObligationsSummaryOfShareBasedCompensationPlanPlan20202023Detail</Role>
      <ShortName>Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2020-2023) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>182</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R183.htm</HtmlFileName>
      <LongName>999175 - Disclosure - Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2021-2024) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EmployeeBenefitPlansAndSimilarObligationsSummaryOfShareBasedCompensationPlanPlan20212024Detail</Role>
      <ShortName>Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2021-2024) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>183</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R184.htm</HtmlFileName>
      <LongName>999176 - Disclosure - Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2022-2025) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EmployeeBenefitPlansAndSimilarObligationsSummaryOfShareBasedCompensationPlanPlan20222025Detail</Role>
      <ShortName>Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2022-2025) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>184</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R185.htm</HtmlFileName>
      <LongName>999177 - Disclosure - Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2023-2026) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EmployeeBenefitPlansAndSimilarObligationsSummaryOfShareBasedCompensationPlanPlan20232026Detail</Role>
      <ShortName>Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2023-2026) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>185</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R186.htm</HtmlFileName>
      <LongName>999178 - Disclosure - Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2024-2027) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EmployeeBenefitPlansAndSimilarObligationsSummaryOfShareBasedCompensationPlanPlan20242027Detail</Role>
      <ShortName>Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2024-2027) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>186</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R187.htm</HtmlFileName>
      <LongName>999179 - Disclosure - Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2025-2028) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/EmployeeBenefitPlansAndSimilarObligationsSummaryOfShareBasedCompensationPlanPlan20252028Detail</Role>
      <ShortName>Employee Benefit Plans and Similar Obligations - Summary of Share Based Compensation Plan (Plan 2025-2028) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>187</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R188.htm</HtmlFileName>
      <LongName>999180 - Disclosure - Subsequent Events - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SubsequentEventsAdditionalInformationDetail</Role>
      <ShortName>Subsequent Events - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>188</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R189.htm</HtmlFileName>
      <LongName>999181 - Disclosure - Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Changes in YPF's Net Proved Reserves (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedSummaryOfChangesInYpfsNetProvedReservesDetail</Role>
      <ShortName>Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Changes in YPF's Net Proved Reserves (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>189</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R190.htm</HtmlFileName>
      <LongName>999182 - Disclosure - Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Changes in YPF's Net Proved Reserves (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedSummaryOfChangesInYpfsNetProvedReservesParentheticalDetail</Role>
      <ShortName>Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Changes in YPF's Net Proved Reserves (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>190</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R191.htm</HtmlFileName>
      <LongName>999183 - Disclosure - Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedAdditionalInformationDetail</Role>
      <ShortName>Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>191</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R192.htm</HtmlFileName>
      <LongName>999184 - Disclosure - Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Capitalized Costs, Along with the related Accumulated Depreciation and Allowances (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedSummaryOfCapitalizedCostsAlongWithTheRelatedAccumulatedDepreciationAndAllowancesDetail</Role>
      <ShortName>Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Capitalized Costs, Along with the related Accumulated Depreciation and Allowances (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>192</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R193.htm</HtmlFileName>
      <LongName>999185 - Disclosure - Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Capitalized Costs, Along with the related Accumulated Depreciation and Allowances (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedSummaryOfCapitalizedCostsAlongWithTheRelatedAccumulatedDepreciationAndAllowancesParentheticalDetail</Role>
      <ShortName>Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Capitalized Costs, Along with the related Accumulated Depreciation and Allowances (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>193</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R194.htm</HtmlFileName>
      <LongName>999186 - Disclosure - Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Costs Incurred for Oil and Gas Producing Activities (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedCostsIncurredForOilAndGasProducingActivitiesDetail</Role>
      <ShortName>Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Costs Incurred for Oil and Gas Producing Activities (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>194</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R195.htm</HtmlFileName>
      <LongName>999187 - Disclosure - Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Costs Incurred for Oil and Gas Producing Activities (Parenthetical) (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedCostsIncurredForOilAndGasProducingActivitiesParentheticalDetail</Role>
      <ShortName>Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Costs Incurred for Oil and Gas Producing Activities (Parenthetical) (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>195</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R196.htm</HtmlFileName>
      <LongName>999188 - Disclosure - Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Results of Operations from Oil and Gas Producing Activities (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedResultsOfOperationsFromOilAndGasProducingActivitiesDetail</Role>
      <ShortName>Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Results of Operations from Oil and Gas Producing Activities (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>196</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R197.htm</HtmlFileName>
      <LongName>999189 - Disclosure - Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Standardized Measure of Discounted Future Net Cash Flows (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedSummaryOfStandardizedMeasureOfDiscountedFutureNetCashFlowsDetail</Role>
      <ShortName>Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Standardized Measure of Discounted Future Net Cash Flows (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>197</Position>
    </Report>
    <Report instance="d95578d20f.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R198.htm</HtmlFileName>
      <LongName>999190 - Disclosure - Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Changes in the Standardized Measure of Discounted Future Net Cash Flows (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ypf.com/role/SupplementalInformationOnOilAndGasProducingActivitiesUnauditedSummaryOfChangesInTheStandardizedMeasureOfDiscountedFutureNetCashFlowsDetail</Role>
      <ShortName>Supplemental Information on Oil And Gas Producing Activities (Unaudited) - Summary of Changes in the Standardized Measure of Discounted Future Net Cash Flows (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>198</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" isDefinitelyFs="true" isIfrs="true" isUsgaap="true" original="d95578d20f.htm">d95578d20f.htm</File>
    <File>ypf-20251231.xsd</File>
  </InputFiles>
  <SupplementalFiles>
    <File>g95578dsp2.jpg</File>
    <File>g95578dsp3.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy items="43">http://fasb.org/srt/2025</BaseTaxonomy>
    <BaseTaxonomy items="14">http://xbrl.sec.gov/cyd/2025</BaseTaxonomy>
    <BaseTaxonomy items="49">http://xbrl.sec.gov/dei/2025</BaseTaxonomy>
    <BaseTaxonomy items="1">http://xbrl.sec.gov/ecd/2025</BaseTaxonomy>
    <BaseTaxonomy items="3452">https://xbrl.ifrs.org/taxonomy/2025-03-27/ifrs-full</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>false</HasPresentationLinkbase>
  <HasCalculationLinkbase>false</HasCalculationLinkbase>
</FilingSummary>
