<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2026"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="olma-20261012.xsd" xlink:type="simple"/>
    <context id="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001750284</identifier>
        </entity>
        <period>
            <startDate>2026-10-12</startDate>
            <endDate>2026-10-12</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_d1749e72-8e8f-49ca-a24f-415753e3a5da">0001750284</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_721a4352-34c5-41d2-b6a1-49a658d9586d">false</dei:AmendmentFlag>
    <dei:DocumentType
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_9970a6eb-064c-4200-b9b5-c79ee1a9011f">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_91344e97-396f-4244-b186-44c6169d5e55">2026-10-12</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_7390e0a3-a58b-441b-8235-4857c75c381f">Olema Pharmaceuticals, Inc.</dei:EntityRegistrantName>
    <dei:EntityIncorporationStateCountryCode
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_8b0365d9-611d-4ec0-a171-2ff70debb5e0">DE</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_4205e1fa-a685-418c-a02b-39f79590b238">001-39712</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_fd06ae12-31c6-4ddc-89f8-e1c75b85938f">30-0409740</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_c4c1a618-d561-4283-a43f-e8f429a3dc6d">780 Brannan Street</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_71e075f4-5400-44df-ab40-581d1c74cdbc">San Francisco</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_efff6a9e-2785-47af-9faf-42a3387c8676">CA</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_39fcc4d9-648c-4b4b-a867-38c9c6450d00">94103</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_58b3bc74-61ca-4707-b48c-b9164e5b7da9">415</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_741b521e-7a02-4b3f-8f1c-b38ad1da3ea5">651-3316</dei:LocalPhoneNumber>
    <dei:EntityInformationFormerLegalOrRegisteredName
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_4989a9ae-eb1e-4510-8ffe-969d04b98323">N/A</dei:EntityInformationFormerLegalOrRegisteredName>
    <dei:WrittenCommunications
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_3fc711e0-08cb-491a-b101-657b959d2494">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_61d9f875-b713-4981-9ced-5c9d95fb5ca4">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_85177865-130d-4e5c-b0b7-4ebdb90079fb">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_341d2407-075b-40ed-ac9e-d5c1bfbb12a1">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_bdce7e9e-3c0d-4a0f-989e-f3d89bd63b66">Common Stock, par value $0.0001 per share</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_55c90537-4ed2-486c-83d1-73590f1c0edd">OLMA</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_9bc67e46-157a-4d60-b4a6-7b17466dd568">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="C_b3066bac-33f2-471f-9bfa-957edfcfa3a9"
      id="F_c90269e3-5ce0-4b5e-9e5b-9cb9c73bba94">false</dei:EntityEmergingGrowthCompany>
</xbrl>
