<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2025"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="olma-20260427.xsd" xlink:type="simple"/>
    <context id="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001750284</identifier>
        </entity>
        <period>
            <startDate>2026-04-27</startDate>
            <endDate>2026-04-27</endDate>
        </period>
    </context>
    <dei:AmendmentFlag
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_ca765887-b6a8-40d2-a465-a11d86408632">false</dei:AmendmentFlag>
    <dei:EntityCentralIndexKey
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_becfe265-5b01-49af-a9cc-15186fbbfafb">0001750284</dei:EntityCentralIndexKey>
    <dei:DocumentType
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_28a4870b-9272-41b0-8366-7b0db4ab3589">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_246334b1-e01c-4905-ac05-008379665a6f">2026-04-27</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_2664b941-9118-4e70-b4c6-e81b557bc179">Olema Pharmaceuticals, Inc.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_52b46be6-7bc3-4b55-9db2-605862b24756">DE</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_af5a8592-e577-4dfb-a27a-53ef0ce5d33a">001-39712</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_14a41ee9-fa66-4372-9999-f76997b5ed86">30-0409740</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_ebf5fa12-cfa2-43af-9ae3-5f179a2e830c">780 Brannan Street</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_978e0407-68d4-4d39-b9ab-fdd1e422f6ed">San Francisco</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_3b71532f-6420-4ad5-8231-e3b189e69ff2">CA</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_5c5e83f1-ee20-44fc-8c80-1eb20dfce658">94103</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_6b81a672-08f6-41ac-84c9-e6af398eca2a">415</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_8d87e7f3-09ee-41b5-8552-c939f0321ccf">651-3316</dei:LocalPhoneNumber>
    <dei:EntityInformationFormerLegalOrRegisteredName
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_5c454058-1dc1-4ebc-838e-09c7262726f0">N/A</dei:EntityInformationFormerLegalOrRegisteredName>
    <dei:WrittenCommunications
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_52f06b3c-ea31-4d18-9e01-181131dea037">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_a6381c14-d390-4190-a9fa-bfc97ecc0aa3">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_74585be9-d073-4293-83aa-3fe13323c7fb">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_ab4473ed-803b-41bf-8377-aed8f3022f96">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_e3a19fd2-c2be-45ed-8710-45b28d69043c">Common Stock, par value $0.0001 per share</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_dfebafbf-6fc3-457a-9c1c-a57f061f36a8">OLMA</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_37752935-f5ba-4523-bace-29d9d5e4577d">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="C_d9d907d0-8bc1-4ce0-b1da-bdadb6497408"
      id="F_c9c25c45-4337-4719-9842-3ec31d42533b">false</dei:EntityEmergingGrowthCompany>
</xbrl>
