<?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="ubsi-20260513.xsd" xlink:type="simple"/>
    <context id="duration_2026-05-13_to_2026-05-13">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000729986</identifier>
        </entity>
        <period>
            <startDate>2026-05-13</startDate>
            <endDate>2026-05-13</endDate>
        </period>
    </context>
    <dei:EntityRegistrantName
      contextRef="duration_2026-05-13_to_2026-05-13"
      id="Hidden_dei_EntityRegistrantName">UNITED BANKSHARES INC/WV</dei:EntityRegistrantName>
    <dei:AmendmentFlag contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-637">false</dei:AmendmentFlag>
    <dei:EntityCentralIndexKey
      contextRef="duration_2026-05-13_to_2026-05-13"
      id="Hidden_dei_EntityCentralIndexKey">0000729986</dei:EntityCentralIndexKey>
    <dei:DocumentType contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-648">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-649">2026-05-13</dei:DocumentPeriodEndDate>
    <dei:EntityIncorporationStateCountryCode contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-650">WV</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-651">002-86947</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-652">55-0641179</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1 contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-653">300 United Center</dei:EntityAddressAddressLine1>
    <dei:EntityAddressAddressLine2 contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-654">500 Virginia Street</dei:EntityAddressAddressLine2>
    <dei:EntityAddressAddressLine3 contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-655">East</dei:EntityAddressAddressLine3>
    <dei:EntityAddressCityOrTown contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-656">Charleston</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-657">WV</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-658">25301</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-659">(304)</dei:CityAreaCode>
    <dei:LocalPhoneNumber contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-660">424-8800</dei:LocalPhoneNumber>
    <dei:WrittenCommunications contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-661">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-662">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-663">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-664">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-665">Common Stock, par value $2.50 per share</dei:Security12bTitle>
    <dei:TradingSymbol contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-666">UBSI</dei:TradingSymbol>
    <dei:SecurityExchangeName contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-667">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany contextRef="duration_2026-05-13_to_2026-05-13" id="ixv-668">false</dei:EntityEmergingGrowthCompany>
</xbrl>
