<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2019-01-31"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="twou-20210428.xsd" xlink:type="simple"/>
    <context id="duration_2021-04-28_to_2021-04-28">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0001459417</identifier>
        </entity>
        <period>
            <startDate>2021-04-28</startDate>
            <endDate>2021-04-28</endDate>
        </period>
    </context>
    <dei:EntityIncorporationStateCountryCode
      contextRef="duration_2021-04-28_to_2021-04-28"
      id="Hidden_dei_EntityIncorporationStateCountryCode">DE</dei:EntityIncorporationStateCountryCode>
    <dei:AmendmentFlag contextRef="duration_2021-04-28_to_2021-04-28">false</dei:AmendmentFlag>
    <dei:EntityCentralIndexKey
      contextRef="duration_2021-04-28_to_2021-04-28"
      id="Hidden_dei_EntityCentralIndexKey">0001459417</dei:EntityCentralIndexKey>
    <dei:DocumentType contextRef="duration_2021-04-28_to_2021-04-28">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate contextRef="duration_2021-04-28_to_2021-04-28">2021-04-28</dei:DocumentPeriodEndDate>
    <dei:EntityRegistrantName contextRef="duration_2021-04-28_to_2021-04-28">2U, INC.</dei:EntityRegistrantName>
    <dei:EntityFileNumber contextRef="duration_2021-04-28_to_2021-04-28">001-36376</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber contextRef="duration_2021-04-28_to_2021-04-28">26-2335939</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1 contextRef="duration_2021-04-28_to_2021-04-28">7900 Harkins Road</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown contextRef="duration_2021-04-28_to_2021-04-28">Lanham</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince contextRef="duration_2021-04-28_to_2021-04-28">MD</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode contextRef="duration_2021-04-28_to_2021-04-28">20706</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode contextRef="duration_2021-04-28_to_2021-04-28">(301)</dei:CityAreaCode>
    <dei:LocalPhoneNumber contextRef="duration_2021-04-28_to_2021-04-28">892-4350</dei:LocalPhoneNumber>
    <dei:WrittenCommunications contextRef="duration_2021-04-28_to_2021-04-28">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial contextRef="duration_2021-04-28_to_2021-04-28">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer contextRef="duration_2021-04-28_to_2021-04-28">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer contextRef="duration_2021-04-28_to_2021-04-28">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle contextRef="duration_2021-04-28_to_2021-04-28">Common Stock, $0.001 par value per share</dei:Security12bTitle>
    <dei:TradingSymbol contextRef="duration_2021-04-28_to_2021-04-28">TWOU</dei:TradingSymbol>
    <dei:SecurityExchangeName contextRef="duration_2021-04-28_to_2021-04-28">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany contextRef="duration_2021-04-28_to_2021-04-28">false</dei:EntityEmergingGrowthCompany>
</xbrl>
