<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.23.3</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>297</ContextCount>
  <ElementCount>311</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>56</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>5</UnitCount>
  <MyReports>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>00090 - Document - Document And Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DocumentDocumentAndEntityInformation</Role>
      <ShortName>Document And Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>00100 - Statement - Condensed Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/StatementCondensedConsolidatedBalanceSheets</Role>
      <ShortName>Condensed Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>00105 - Statement - Condensed Consolidated Balance Sheets (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/StatementCondensedConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Condensed Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>00200 - Statement - Condensed Consolidated Statements of Income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/StatementCondensedConsolidatedStatementsOfIncome</Role>
      <ShortName>Condensed Consolidated Statements of Income</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>00300 - Statement - Condensed Consolidated Statements of Comprehensive Income (Loss)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/StatementCondensedConsolidatedStatementsOfComprehensiveIncomeLoss</Role>
      <ShortName>Condensed Consolidated Statements of Comprehensive Income (Loss)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>00305 - Statement - Condensed Consolidated Statements of Comprehensive (Loss) (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/StatementCondensedConsolidatedStatementsOfComprehensiveLossParenthetical</Role>
      <ShortName>Condensed Consolidated Statements of Comprehensive (Loss) (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>00400 - Statement - Consolidated Statements of Stockholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/StatementConsolidatedStatementsOfStockholdersEquity</Role>
      <ShortName>Consolidated Statements of Stockholders' Equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>00405 - Statement - Consolidated Statements of Stockholders' Equity (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/StatementConsolidatedStatementsOfStockholdersEquityParenthetical</Role>
      <ShortName>Consolidated Statements of Stockholders' Equity (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>00500 - Statement - Condensed Consolidated Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/StatementCondensedConsolidatedStatementsOfCashFlows</Role>
      <ShortName>Condensed Consolidated Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>10101 - Disclosure - Summary of Significant Accounting Policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSummaryOfSignificantAccountingPolicies</Role>
      <ShortName>Summary of Significant Accounting Policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>10201 - Disclosure - Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSecurities</Role>
      <ShortName>Securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>10301 - Disclosure - Loans and Allowance for Credit Losses</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureLoansAndAllowanceForCreditLosses</Role>
      <ShortName>Loans and Allowance for Credit Losses</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>10401 - Disclosure - Benefit Plans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureBenefitPlans</Role>
      <ShortName>Benefit Plans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>10501 - Disclosure - Off-balance-sheet Activities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureOffBalanceSheetActivities</Role>
      <ShortName>Off-balance-sheet Activities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>10601 - Disclosure - Accumulated Other Comprehensive Income (Loss)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureAccumulatedOtherComprehensiveIncomeLoss</Role>
      <ShortName>Accumulated Other Comprehensive Income (Loss)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>10701 - Disclosure - Fair Value Measurements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureFairValueMeasurements</Role>
      <ShortName>Fair Value Measurements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>10801 - Disclosure - Repurchase Agreements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureRepurchaseAgreements</Role>
      <ShortName>Repurchase Agreements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>10901 - Disclosure - Core Deposits and Intangible Assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureCoreDepositsAndIntangibleAssets</Role>
      <ShortName>Core Deposits and Intangible Assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>11001 - Disclosure - Advances from the Federal Home Loan Bank</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureAdvancesFromFederalHomeLoanBank</Role>
      <ShortName>Advances from the Federal Home Loan Bank</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>20102 - Disclosure - Summary of Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSummaryOfSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Summary of Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureSummaryOfSignificantAccountingPolicies</ParentRole>
      <Position>20</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>30103 - Disclosure - Summary of Significant Accounting Policies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSummaryOfSignificantAccountingPoliciesTables</Role>
      <ShortName>Summary of Significant Accounting Policies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureSummaryOfSignificantAccountingPolicies</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>30203 - Disclosure - Securities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSecuritiesTables</Role>
      <ShortName>Securities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureSecurities</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>30303 - Disclosure - Loans and Allowance for Credit Losses (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureLoansAndAllowanceForCreditLossesTables</Role>
      <ShortName>Loans and Allowance for Credit Losses (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureLoansAndAllowanceForCreditLosses</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>30403 - Disclosure - Benefit Plans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureBenefitPlansTables</Role>
      <ShortName>Benefit Plans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureBenefitPlans</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>30503 - Disclosure - Off-balance-sheet Activities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureOffBalanceSheetActivitiesTables</Role>
      <ShortName>Off-balance-sheet Activities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureOffBalanceSheetActivities</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>30603 - Disclosure - Accumulated Other Comprehensive Income (Loss) (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureAccumulatedOtherComprehensiveIncomeLossTables</Role>
      <ShortName>Accumulated Other Comprehensive Income (Loss) (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureAccumulatedOtherComprehensiveIncomeLoss</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>30703 - Disclosure - Fair Value Measurements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureFairValueMeasurementsTables</Role>
      <ShortName>Fair Value Measurements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureFairValueMeasurements</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>30803 - Disclosure - Repurchase Agreements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureRepurchaseAgreementsTables</Role>
      <ShortName>Repurchase Agreements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureRepurchaseAgreements</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>30903 - Disclosure - Core Deposits and Intangible Assets (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureCoreDepositsAndIntangibleAssetsTables</Role>
      <ShortName>Core Deposits and Intangible Assets (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureCoreDepositsAndIntangibleAssets</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>40101 - Disclosure - Summary of Significant Accounting Policies - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSummaryOfSignificantAccountingPoliciesAdditionalInformationDetails</Role>
      <ShortName>Summary of Significant Accounting Policies - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>40102 - Disclosure - Summary of Significant Accounting Policies - Impact of adoption of ASU 2016-13 on allowance for credit Losses on loans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSummaryOfSignificantAccountingPoliciesImpactOfAdoptionOfAsu201613OnAllowanceForCreditLossesOnLoansDetails</Role>
      <ShortName>Summary of Significant Accounting Policies - Impact of adoption of ASU 2016-13 on allowance for credit Losses on loans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>40103 - Disclosure - Summary of Significant Accounting Policies - Earnings per share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSummaryOfSignificantAccountingPoliciesEarningsPerShareDetails</Role>
      <ShortName>Summary of Significant Accounting Policies - Earnings per share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>40201 - Disclosure - Securities - Amortized cost and fair values, together with gross unrealized gains and losses of securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSecuritiesAmortizedCostAndFairValuesTogetherWithGrossUnrealizedGainsAndLossesOfSecuritiesDetails</Role>
      <ShortName>Securities - Amortized cost and fair values, together with gross unrealized gains and losses of securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>40202 - Disclosure - Securities - Schedule of amortized cost and fair value of available-for-sale securities by contractual maturity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSecuritiesScheduleOfAmortizedCostAndFairValueOfAvailableForSaleSecuritiesByContractualMaturityDetails</Role>
      <ShortName>Securities - Schedule of amortized cost and fair value of available-for-sale securities by contractual maturity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>40203 - Disclosure - Securities - Schedule of company's investments' gross unrealized losses and fair value, aggregated by investment category and length of time (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSecuritiesScheduleOfCompanySInvestmentsGrossUnrealizedLossesAndFairValueAggregatedByInvestmentCategoryAndLengthOfTimeDetails</Role>
      <ShortName>Securities - Schedule of company's investments' gross unrealized losses and fair value, aggregated by investment category and length of time (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>40204 - Disclosure - Securities - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureSecuritiesAdditionalInformationDetails</Role>
      <ShortName>Securities - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>40301 - Disclosure - Loans and Allowance for Credit Losses - Schedule of Categories of Loans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureLoansAndAllowanceForCreditLossesScheduleOfCategoriesOfLoansDetails</Role>
      <ShortName>Loans and Allowance for Credit Losses - Schedule of Categories of Loans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>40302 - Disclosure - Loans and Allowance for Credit Losses - Schedule of Allowance for Credit Losses and Recorded Investment in Loans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureLoansAndAllowanceForCreditLossesScheduleOfAllowanceForCreditLossesAndRecordedInvestmentInLoansDetails</Role>
      <ShortName>Loans and Allowance for Credit Losses - Schedule of Allowance for Credit Losses and Recorded Investment in Loans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>40303 - Disclosure - Loans and Allowance for Credit Losses - Schedule of Portfolio Quality Indicators (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureLoansAndAllowanceForCreditLossesScheduleOfPortfolioQualityIndicatorsDetails</Role>
      <ShortName>Loans and Allowance for Credit Losses - Schedule of Portfolio Quality Indicators (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>40304 - Disclosure - Loans and Allowance for Credit Losses - Schedule of Loan Portfolio Aging Analysis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureLoansAndAllowanceForCreditLossesScheduleOfLoanPortfolioAgingAnalysisDetails</Role>
      <ShortName>Loans and Allowance for Credit Losses - Schedule of Loan Portfolio Aging Analysis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>40305 - Disclosure - Loans and Allowance for Credit Losses - Schedule of Impaired Loans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureLoansAndAllowanceForCreditLossesScheduleOfImpairedLoansDetails</Role>
      <ShortName>Loans and Allowance for Credit Losses - Schedule of Impaired Loans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>40306 - Disclosure - Loans and Allowance for Credit Losses - Schedule of Troubled Debt Restructurings on Financing Receivables (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureLoansAndAllowanceForCreditLossesScheduleOfTroubledDebtRestructuringsOnFinancingReceivablesDetails</Role>
      <ShortName>Loans and Allowance for Credit Losses - Schedule of Troubled Debt Restructurings on Financing Receivables (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>40401 - Disclosure - Benefit Plans - (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureBenefitPlansDetails</Role>
      <ShortName>Benefit Plans - (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureBenefitPlansTables</ParentRole>
      <Position>43</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>40501 - Disclosure - Off-balance-sheet Activities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureOffBalanceSheetActivitiesDetails</Role>
      <ShortName>Off-balance-sheet Activities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureOffBalanceSheetActivitiesTables</ParentRole>
      <Position>44</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>40601 - Disclosure - Accumulated Other Comprehensive Income (Loss) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureAccumulatedOtherComprehensiveIncomeLossDetails</Role>
      <ShortName>Accumulated Other Comprehensive Income (Loss) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureAccumulatedOtherComprehensiveIncomeLossTables</ParentRole>
      <Position>45</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>40701 - Disclosure - Fair Value Measurements - Assets Recognized in Consolidated Balance Sheets Measured at Fair Value on Recurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureFairValueMeasurementsAssetsRecognizedInConsolidatedBalanceSheetsMeasuredAtFairValueOnRecurringBasisDetails</Role>
      <ShortName>Fair Value Measurements - Assets Recognized in Consolidated Balance Sheets Measured at Fair Value on Recurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>40702 - Disclosure - Fair Value Measurements - Assets Recognized in Consolidated Balance Sheets Measured at Fair Value on Nonrecurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureFairValueMeasurementsAssetsRecognizedInConsolidatedBalanceSheetsMeasuredAtFairValueOnNonrecurringBasisDetails</Role>
      <ShortName>Fair Value Measurements - Assets Recognized in Consolidated Balance Sheets Measured at Fair Value on Nonrecurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>40703 - Disclosure - Fair Value Measurements - Quantitative Information About Unobservable Inputs Used in Recurring and Nonrecurring Level 3 Fair Value Measurements (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureFairValueMeasurementsQuantitativeInformationAboutUnobservableInputsUsedInRecurringAndNonrecurringLevel3FairValueMeasurementsDetails</Role>
      <ShortName>Fair Value Measurements - Quantitative Information About Unobservable Inputs Used in Recurring and Nonrecurring Level 3 Fair Value Measurements (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>40704 - Disclosure - Fair Value Measurements - Estimated Fair Values of Company's Financial Instruments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureFairValueMeasurementsEstimatedFairValuesOfCompanySFinancialInstrumentsDetails</Role>
      <ShortName>Fair Value Measurements - Estimated Fair Values of Company's Financial Instruments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>40801 - Disclosure - Repurchase Agreements - Remaining Contractual Maturity of the Agreement (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureRepurchaseAgreementsRemainingContractualMaturityOfAgreementDetails</Role>
      <ShortName>Repurchase Agreements - Remaining Contractual Maturity of the Agreement (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>40802 - Disclosure - Repurchase Agreements - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureRepurchaseAgreementsAdditionalInformationDetails</Role>
      <ShortName>Repurchase Agreements - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>40901 - Disclosure - Core Deposits and Intangible Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureCoreDepositsAndIntangibleAssetsDetails</Role>
      <ShortName>Core Deposits and Intangible Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureCoreDepositsAndIntangibleAssetsTables</ParentRole>
      <Position>52</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>40902 - Disclosure - Core Deposits and Intangible Assets - Intangible assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureCoreDepositsAndIntangibleAssetsIntangibleAssetsDetails</Role>
      <ShortName>Core Deposits and Intangible Assets - Intangible assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>40903 - Disclosure - Core Deposits and Intangible Assets - Future amortization expense (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureCoreDepositsAndIntangibleAssetsFutureAmortizationExpenseDetails</Role>
      <ShortName>Core Deposits and Intangible Assets - Future amortization expense (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="ubcp-20230930x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>41001 - Disclosure - Advances from the Federal Home Loan Bank (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.unitedbancorp.com/role/DisclosureAdvancesFromFederalHomeLoanBankDetails</Role>
      <ShortName>Advances from the Federal Home Loan Bank (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.unitedbancorp.com/role/DisclosureAdvancesFromFederalHomeLoanBank</ParentRole>
      <Position>55</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File>ubcp-20230930.xsd</File>
    <File>ubcp-20230930_cal.xml</File>
    <File>ubcp-20230930_def.xml</File>
    <File>ubcp-20230930_lab.xml</File>
    <File>ubcp-20230930_pre.xml</File>
    <File doctype="10-Q" isDefinitelyFs="true" isUsgaap="true" original="ubcp-20230930x10q.htm">ubcp-20230930x10q.htm</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="1084">http://fasb.org/us-gaap/2023</BaseTaxonomy>
    <BaseTaxonomy items="29">http://xbrl.sec.gov/dei/2023</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
