<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.23.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>300</ContextCount>
  <ElementCount>426</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>96</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>15</UnitCount>
  <MyReports>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>00090 - Document - Cover</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DocumentCover</Role>
      <ShortName>Cover</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>00100 - Statement - Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/StatementConsolidatedBalanceSheets</Role>
      <ShortName>Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>00105 - Statement - Consolidated Balance Sheets (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/StatementConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>00200 - Statement - Consolidated Statements of Operations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/StatementConsolidatedStatementsOfOperations</Role>
      <ShortName>Consolidated Statements of Operations</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>00300 - Statement - Consolidated Statements of Comprehensive Loss</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/StatementConsolidatedStatementsOfComprehensiveLoss</Role>
      <ShortName>Consolidated Statements of Comprehensive Loss</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>00400 - Statement - Consolidated Statements of Stockholders' (Deficit) Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/StatementConsolidatedStatementsOfStockholdersDeficitEquity</Role>
      <ShortName>Consolidated Statements of Stockholders' (Deficit) Equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>00500 - Statement - Consolidated Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/StatementConsolidatedStatementsOfCashFlows</Role>
      <ShortName>Consolidated Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>10201 - Disclosure - Summary of significant accounting policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureSummaryOfSignificantAccountingPolicies</Role>
      <ShortName>Summary of significant accounting policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>10301 - Disclosure - Leases</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureLeases</Role>
      <ShortName>Leases</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>10401 - Disclosure - Fair value of financial instruments and investments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestments</Role>
      <ShortName>Fair value of financial instruments and investments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>10501 - Disclosure - Accounts payable and accrued expenses</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureAccountsPayableAndAccruedExpenses</Role>
      <ShortName>Accounts payable and accrued expenses</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>10601 - Disclosure - Capitalization</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureCapitalization</Role>
      <ShortName>Capitalization</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>10701 - Disclosure - Net loss per share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureNetLossPerShare</Role>
      <ShortName>Net loss per share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>10801 - Disclosure - Stock award plan</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureStockAwardPlan</Role>
      <ShortName>Stock award plan</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>10901 - Disclosure - Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureDebt</Role>
      <ShortName>Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>11001 - Disclosure - Commitments and contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureCommitmentsAndContingencies</Role>
      <ShortName>Commitments and contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>11101 - Disclosure - Revenue recognition</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureRevenueRecognition</Role>
      <ShortName>Revenue recognition</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>11201 - Disclosure - Intangible assets and goodwill</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureIntangibleAssetsAndGoodwill</Role>
      <ShortName>Intangible assets and goodwill</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>11301 - Disclosure - Subsequent events</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureSubsequentEvents</Role>
      <ShortName>Subsequent events</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>20202 - Disclosure - Summary of significant accounting policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureSummaryOfSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Summary of significant accounting policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>30203 - Disclosure - Summary of significant accounting policies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureSummaryOfSignificantAccountingPoliciesTables</Role>
      <ShortName>Summary of significant accounting policies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ptcbio.com/role/DisclosureSummaryOfSignificantAccountingPolicies</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>30303 - Disclosure - Leases - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureLeasesTables</Role>
      <ShortName>Leases - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>30403 - Disclosure - Fair value of financial instruments and investments - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestmentsTables</Role>
      <ShortName>Fair value of financial instruments and investments - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestments</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>30503 - Disclosure - Accounts payable and accrued expenses - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureAccountsPayableAndAccruedExpensesTables</Role>
      <ShortName>Accounts payable and accrued expenses - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ptcbio.com/role/DisclosureAccountsPayableAndAccruedExpenses</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>30703 - Disclosure - Net loss per share - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureNetLossPerShareTables</Role>
      <ShortName>Net loss per share - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ptcbio.com/role/DisclosureNetLossPerShare</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>30803 - Disclosure - Stock award plan - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureStockAwardPlanTables</Role>
      <ShortName>Stock award plan - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ptcbio.com/role/DisclosureStockAwardPlan</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>30903 - Disclosure - Debt - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureDebtTables</Role>
      <ShortName>Debt - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>27</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>31203 - Disclosure - Intangible assets and goodwill - (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureIntangibleAssetsAndGoodwillTables</Role>
      <ShortName>Intangible assets and goodwill - (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.ptcbio.com/role/DisclosureIntangibleAssetsAndGoodwill</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>40101 - Disclosure - The Company (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureCompanyDetails</Role>
      <ShortName>The Company (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>29</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>40201 - Disclosure - Summary of significant accounting policies - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureSummaryOfSignificantAccountingPoliciesNarrativeDetails</Role>
      <ShortName>Summary of significant accounting policies - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>40202 - Disclosure - Summary of significant accounting policies - Reconciliation of cash (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureSummaryOfSignificantAccountingPoliciesReconciliationOfCashDetails</Role>
      <ShortName>Summary of significant accounting policies - Reconciliation of cash (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>40204 - Disclosure - Summary of significant accounting policies - Inventory (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureSummaryOfSignificantAccountingPoliciesInventoryDetails</Role>
      <ShortName>Summary of significant accounting policies - Inventory (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>40205 - Disclosure - Summary of significant accounting policies - Collaboration and Royalty Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureSummaryOfSignificantAccountingPoliciesCollaborationAndRoyaltyRevenueDetails</Role>
      <ShortName>Summary of significant accounting policies - Collaboration and Royalty Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>40206 - Disclosure - Summary of significant accounting policies - Manufacturing Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureSummaryOfSignificantAccountingPoliciesManufacturingRevenueDetails</Role>
      <ShortName>Summary of significant accounting policies - Manufacturing Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>40207 - Disclosure - Summary of significant accounting policies - Liability for Sale of Future Royalties (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureSummaryOfSignificantAccountingPoliciesLiabilityForSaleOfFutureRoyaltiesDetails</Role>
      <ShortName>Summary of significant accounting policies - Liability for Sale of Future Royalties (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>40301 - Disclosure - Leases - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureLeasesNarrativeDetails</Role>
      <ShortName>Leases - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>40302 - Disclosure - Leases - Lease costs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureLeasesLeaseCostsDetails</Role>
      <ShortName>Leases - Lease costs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>40303 - Disclosure - Leases - Supplemental lease terms (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureLeasesSupplementalLeaseTermsDetails</Role>
      <ShortName>Leases - Supplemental lease terms (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>40304 - Disclosure - Leases - Cash flow (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureLeasesCashFlowDetails</Role>
      <ShortName>Leases - Cash flow (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>40305 - Disclosure - Leases - Lease payments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureLeasesLeasePaymentsDetails</Role>
      <ShortName>Leases - Lease payments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>40401 - Disclosure - Fair value of financial instruments and investments - Marketable Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestmentsMarketableSecuritiesDetails</Role>
      <ShortName>Fair value of financial instruments and investments - Marketable Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>40402 - Disclosure - Fair value of financial instruments and investments - Hierarchy (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestmentsHierarchyDetails</Role>
      <ShortName>Fair value of financial instruments and investments - Hierarchy (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestmentsTables</ParentRole>
      <Position>42</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>40403 - Disclosure - Fair value of financial instruments and investments - Marketable Securities, Unrealized Gains (Losses) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestmentsMarketableSecuritiesUnrealizedGainsLossesDetails</Role>
      <ShortName>Fair value of financial instruments and investments - Marketable Securities, Unrealized Gains (Losses) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>40404 - Disclosure - Fair value of financial instruments and investments - Available-for-sale securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestmentsAvailableForSaleSecuritiesDetails</Role>
      <ShortName>Fair value of financial instruments and investments - Available-for-sale securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>40405 - Disclosure - Fair value of financial instruments and investments - Marketable Securities, Balance Sheet Disclosures (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestmentsMarketableSecuritiesBalanceSheetDisclosuresDetails</Role>
      <ShortName>Fair value of financial instruments and investments - Marketable Securities, Balance Sheet Disclosures (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>40406 - Disclosure - Fair value of financial instruments and investments - Convertible senior notes (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestmentsConvertibleSeniorNotesDetails</Role>
      <ShortName>Fair value of financial instruments and investments - Convertible senior notes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>40407 - Disclosure - Fair value of financial instruments and investments - Summary of changes in the fair value of the Company's Level 3 valuation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestmentsSummaryOfChangesInFairValueOfCompanySLevel3ValuationDetails</Role>
      <ShortName>Fair value of financial instruments and investments - Summary of changes in the fair value of the Company's Level 3 valuation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>40408 - Disclosure - Fair value of financial instruments and investments - Fair Value Liabilities Measured (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureFairValueOfFinancialInstrumentsAndInvestmentsFairValueLiabilitiesMeasuredDetails</Role>
      <ShortName>Fair value of financial instruments and investments - Fair Value Liabilities Measured (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>40501 - Disclosure - Accounts payable and accrued expenses - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureAccountsPayableAndAccruedExpensesNarrativeDetails</Role>
      <ShortName>Accounts payable and accrued expenses - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>40601 - Disclosure - Capitalization - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureCapitalizationNarrativeDetails</Role>
      <ShortName>Capitalization - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>40701 - Disclosure - Net loss per share - Numerator and Denominator (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureNetLossPerShareNumeratorAndDenominatorDetails</Role>
      <ShortName>Net loss per share - Numerator and Denominator (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>40702 - Disclosure - Net loss per share - Antidilutive (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureNetLossPerShareAntidilutiveDetails</Role>
      <ShortName>Net loss per share - Antidilutive (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>40801 - Disclosure - Stock award plan - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureStockAwardPlanNarrativeDetails</Role>
      <ShortName>Stock award plan - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>40802 - Disclosure - Stock award plan - Stock Option Activity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureStockAwardPlanStockOptionActivityDetails</Role>
      <ShortName>Stock award plan - Stock Option Activity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>40803 - Disclosure - Stock award plan - Assumptions Used (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureStockAwardPlanAssumptionsUsedDetails</Role>
      <ShortName>Stock award plan - Assumptions Used (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>40804 - Disclosure - Stock award plan - Restricted Stock (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureStockAwardPlanRestrictedStockDetails</Role>
      <ShortName>Stock award plan - Restricted Stock (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>40805 - Disclosure - Stock award plan - Share-based compensation expense (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureStockAwardPlanShareBasedCompensationExpenseDetails</Role>
      <ShortName>Stock award plan - Share-based compensation expense (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>40901 - Disclosure - Debt - Liability for Sale of Future Royalties (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureDebtLiabilityForSaleOfFutureRoyaltiesDetails</Role>
      <ShortName>Debt - Liability for Sale of Future Royalties (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>40902 - Disclosure - Debt - Senior Secured Term Loan (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureDebtSeniorSecuredTermLoanDetails</Role>
      <ShortName>Debt - Senior Secured Term Loan (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>40903 - Disclosure - Debt - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureDebtNarrativeDetails</Role>
      <ShortName>Debt - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>40904 - Disclosure - Debt - Convertible Notes (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureDebtConvertibleNotesDetails</Role>
      <ShortName>Debt - Convertible Notes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>40905 - Disclosure - Debt - Convertible Notes Interest Expense (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureDebtConvertibleNotesInterestExpenseDetails</Role>
      <ShortName>Debt - Convertible Notes Interest Expense (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>41001 - Disclosure - Commitments and contingencies - Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureCommitmentsAndContingenciesNarrativeDetails</Role>
      <ShortName>Commitments and contingencies - Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>41101 - Disclosure - Revenue recognition - Net Product Sales (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureRevenueRecognitionNetProductSalesDetails</Role>
      <ShortName>Revenue recognition - Net Product Sales (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>64</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>41102 - Disclosure - Revenue recognition - Collaboration and Royalty Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureRevenueRecognitionCollaborationAndRoyaltyRevenueDetails</Role>
      <ShortName>Revenue recognition - Collaboration and Royalty Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>65</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>41103 - Disclosure - Revenue recognition - Manufacturing Revenue (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureRevenueRecognitionManufacturingRevenueDetails</Role>
      <ShortName>Revenue recognition - Manufacturing Revenue (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>66</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>41104 - Disclosure - Revenue recognition - Performance Obligations (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureRevenueRecognitionPerformanceObligationsDetails</Role>
      <ShortName>Revenue recognition - Performance Obligations (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>67</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>41201 - Disclosure - Intangible assets and goodwill - Definite-lived Intangibles (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureIntangibleAssetsAndGoodwillDefiniteLivedIntangiblesDetails</Role>
      <ShortName>Intangible assets and goodwill - Definite-lived Intangibles (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>68</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>41202 - Disclosure - Intangible assets and goodwill - Future Amortization (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureIntangibleAssetsAndGoodwillFutureAmortizationDetails</Role>
      <ShortName>Intangible assets and goodwill - Future Amortization (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>69</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>41203 - Disclosure - Intangible assets and goodwill - Indefinite-lived Intangibles (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureIntangibleAssetsAndGoodwillIndefiniteLivedIntangiblesDetails</Role>
      <ShortName>Intangible assets and goodwill - Indefinite-lived Intangibles (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>70</Position>
    </Report>
    <Report instance="tmb-20230331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R71.htm</HtmlFileName>
      <LongName>41204 - Disclosure - Intangible assets and goodwill - Goodwill (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.ptcbio.com/role/DisclosureIntangibleAssetsAndGoodwillGoodwillDetails</Role>
      <ShortName>Intangible assets and goodwill - Goodwill (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>71</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <Logs>
    <Log type="Warning">[ix-0514-Hidden-Fact-Eligible-For-Transform] WARN: 5 fact(s) appearing in ix:hidden were eligible for transformation: ptct:DebtInstrumentConvertibleThresholdBusinessDays, ptct:DebtInstrumentConvertibleThresholdConsecutiveTradingDayPeriod, us-gaap:CommonStockSharesOutstanding, us-gaap:RevenueRemainingPerformanceObligation -  tmb-20230331x10q.htm 9</Log>
  </Logs>
  <InputFiles>
    <File doctype="10-Q" original="tmb-20230331x10q.htm">tmb-20230331x10q.htm</File>
    <File>tmb-20230331.xsd</File>
    <File>tmb-20230331_cal.xml</File>
    <File>tmb-20230331_def.xml</File>
    <File>tmb-20230331_lab.xml</File>
    <File>tmb-20230331_pre.xml</File>
    <File>tmb-20230331xex10d1.htm</File>
    <File>tmb-20230331xex10d2.htm</File>
    <File>tmb-20230331xex31d1.htm</File>
    <File>tmb-20230331xex31d2.htm</File>
    <File>tmb-20230331xex32d1.htm</File>
    <File>tmb-20230331xex32d2.htm</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="720">http://fasb.org/us-gaap/2022</BaseTaxonomy>
    <BaseTaxonomy items="29">http://xbrl.sec.gov/dei/2022</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
