<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.10.0.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>67</ContextCount>
  <ElementCount>155</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>25</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>5</UnitCount>
  <MyReports>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>100000 - Document - Document and Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DocumentDocumentAndEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>100010 - Statement - CONDENSED CONSOLIDATED BALANCE SHEETS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/StatementCONDENSEDCONSOLIDATEDBALANCESHEETS</Role>
      <ShortName>CONDENSED CONSOLIDATED BALANCE SHEETS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>100020 - Statement - CONDENSED CONSOLIDATED BALANCE SHEETS (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/StatementCONDENSEDCONSOLIDATEDBALANCESHEETSParenthetical</Role>
      <ShortName>CONDENSED CONSOLIDATED BALANCE SHEETS (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>100030 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/StatementCONDENSEDCONSOLIDATEDSTATEMENTSOFCOMPREHENSIVEINCOME</Role>
      <ShortName>CONDENSED CONSOLIDATED STATEMENTS OF COMPREHENSIVE INCOME</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>100040 - Statement - CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/StatementCONDENSEDCONSOLIDATEDSTATEMENTSOFCASHFLOWS</Role>
      <ShortName>CONDENSED CONSOLIDATED STATEMENTS OF CASH FLOWS</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>100050 - Disclosure - Nature of Operations</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureNatureOfOperations</Role>
      <ShortName>Nature of Operations</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>100060 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureBasisOfPresentationAndSummaryOfSignificantAccountingPolicies</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>100070 - Disclosure - Earnings Per Share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureEarningsPerShare</Role>
      <ShortName>Earnings Per Share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>100080 - Disclosure - Fair Value Measurements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureFairValueMeasurements</Role>
      <ShortName>Fair Value Measurements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>100090 - Disclosure - Accounts Payable</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureAccountsPayable</Role>
      <ShortName>Accounts Payable</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>100100 - Disclosure - Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureDebt</Role>
      <ShortName>Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>100110 - Disclosure - Stock-Based Compensation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureStockBasedCompensation</Role>
      <ShortName>Stock-Based Compensation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>100120 - Disclosure - Income Taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureIncomeTaxes</Role>
      <ShortName>Income Taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>100130 - Disclosure - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureCommitmentsAndContingencies</Role>
      <ShortName>Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>100140 - Disclosure - Subsequent Event</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureSubsequentEvent</Role>
      <ShortName>Subsequent Event</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>100150 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureBasisOfPresentationAndSummaryOfSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://thetradedesk.com/20180930/taxonomy/role/DisclosureBasisOfPresentationAndSummaryOfSignificantAccountingPolicies</ParentRole>
      <Position>16</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>100160 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureBasisOfPresentationAndSummaryOfSignificantAccountingPoliciesTables</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://thetradedesk.com/20180930/taxonomy/role/DisclosureBasisOfPresentationAndSummaryOfSignificantAccountingPolicies</ParentRole>
      <Position>17</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>100170 - Disclosure - Earnings Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureEarningsPerShareTables</Role>
      <ShortName>Earnings Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://thetradedesk.com/20180930/taxonomy/role/DisclosureEarningsPerShare</ParentRole>
      <Position>18</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>100180 - Disclosure - Accounts Payable (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureAccountsPayableTables</Role>
      <ShortName>Accounts Payable (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://thetradedesk.com/20180930/taxonomy/role/DisclosureAccountsPayable</ParentRole>
      <Position>19</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>100190 - Disclosure - Stock-Based Compensation (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureStockBasedCompensationTables</Role>
      <ShortName>Stock-Based Compensation (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://thetradedesk.com/20180930/taxonomy/role/DisclosureStockBasedCompensation</ParentRole>
      <Position>20</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>100200 - Disclosure - Commitments and Contingencies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureCommitmentsAndContingenciesTables</Role>
      <ShortName>Commitments and Contingencies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://thetradedesk.com/20180930/taxonomy/role/DisclosureCommitmentsAndContingencies</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>100210 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies - Revenue Recognition (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureBasisOfPresentationAndSummaryOfSignificantAccountingPoliciesRevenueRecognitionDetail</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies - Revenue Recognition (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>100220 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies - Gross Billings Based on Billing Address of Clients or Client Affiliates (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureBasisOfPresentationAndSummaryOfSignificantAccountingPoliciesGrossBillingsBasedOnBillingAddressOfClientsOrClientAffiliatesDetail</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies - Gross Billings Based on Billing Address of Clients or Client Affiliates (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>100230 - Disclosure - Basis of Presentation and Summary of Significant Accounting Policies - Allowance for Doubtful Accounts (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureBasisOfPresentationAndSummaryOfSignificantAccountingPoliciesAllowanceForDoubtfulAccountsDetail</Role>
      <ShortName>Basis of Presentation and Summary of Significant Accounting Policies - Allowance for Doubtful Accounts (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>24</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>100240 - Disclosure - Earnings Per Share - Computation of Basic and Diluted Earnings Per Share (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureEarningsPerShareComputationOfBasicAndDilutedEarningsPerShareDetail</Role>
      <ShortName>Earnings Per Share - Computation of Basic and Diluted Earnings Per Share (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>25</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>100250 - Disclosure - Fair Value Measurements - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureFairValueMeasurementsAdditionalInformationDetail</Role>
      <ShortName>Fair Value Measurements - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>26</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>100260 - Disclosure - Accounts Payable (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureAccountsPayableDetail</Role>
      <ShortName>Accounts Payable (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://thetradedesk.com/20180930/taxonomy/role/DisclosureAccountsPayableTables</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>100270 - Disclosure - Debt - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureDebtAdditionalInformationDetail</Role>
      <ShortName>Debt - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>28</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>100280 - Disclosure - Stock-Based Compensation - Schedule of Stock-Based Compensation Expense by Operating Expense Category (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureStockBasedCompensationScheduleOfStockBasedCompensationExpenseByOperatingExpenseCategoryDetail</Role>
      <ShortName>Stock-Based Compensation - Schedule of Stock-Based Compensation Expense by Operating Expense Category (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>29</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>100290 - Disclosure - Stock-Based Compensation - Stock Options (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureStockBasedCompensationStockOptionsDetail</Role>
      <ShortName>Stock-Based Compensation - Stock Options (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>100300 - Disclosure - Stock-Based Compensation - Stock Options - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureStockBasedCompensationStockOptionsAdditionalInformationDetail</Role>
      <ShortName>Stock-Based Compensation - Stock Options - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>100310 - Disclosure - Stock-Based Compensation - Summary of Nonvested Restricted Stock Activity (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureStockBasedCompensationSummaryOfNonvestedRestrictedStockActivityDetail</Role>
      <ShortName>Stock-Based Compensation - Summary of Nonvested Restricted Stock Activity (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>100320 - Disclosure - Stock-Based Compensation - ESPP - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureStockBasedCompensationESPPAdditionalInformationDetail</Role>
      <ShortName>Stock-Based Compensation - ESPP - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>100330 - Disclosure - Income Taxes - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureIncomeTaxesAdditionalInformationDetail</Role>
      <ShortName>Income Taxes - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>100340 - Disclosure - Commitments and Contingencies - Schedule of Minimum Lease Commitments under Non-Cancelable Operating Leases (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureCommitmentsAndContingenciesScheduleOfMinimumLeaseCommitmentsUnderNonCancelableOperatingLeasesDetail</Role>
      <ShortName>Commitments and Contingencies - Schedule of Minimum Lease Commitments under Non-Cancelable Operating Leases (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>100350 - Disclosure - Commitments and Contingencies - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureCommitmentsAndContingenciesAdditionalInformationDetail</Role>
      <ShortName>Commitments and Contingencies - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="ttd-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>100360 - Disclosure - Subsequent Event - Additional Information (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://thetradedesk.com/20180930/taxonomy/role/DisclosureSubsequentEventAdditionalInformationDetail</Role>
      <ShortName>Subsequent Event - Additional Information (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File>ttd-20180930.xml</File>
    <File>ttd-20180930.xsd</File>
    <File>ttd-20180930_cal.xml</File>
    <File>ttd-20180930_def.xml</File>
    <File>ttd-20180930_lab.xml</File>
    <File>ttd-20180930_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy>http://fasb.org/srt/2018-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/dei/2018-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/us-gaap/2018-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/country/2017-01-31</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
