<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.22.2</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>336</ContextCount>
  <ElementCount>287</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>true</FootnotesReported>
  <SegmentCount>77</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>9</UnitCount>
  <MyReports>
    <Report instance="botj-20220630x10q.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.bankofthejames.com/role/DocumentDocumentAndEntityInformation</Role>
      <ShortName>Document And Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>00100 - Statement - Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/StatementConsolidatedBalanceSheets</Role>
      <ShortName>Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="botj-20220630x10q.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.bankofthejames.com/role/StatementConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>00200 - Statement - Consolidated Statements Of Income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/StatementConsolidatedStatementsOfIncome</Role>
      <ShortName>Consolidated Statements Of Income</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>00300 - Statement - Consolidated Statements of Comprehensive (Loss) Income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/StatementConsolidatedStatementsOfComprehensiveLossIncome</Role>
      <ShortName>Consolidated Statements of Comprehensive (Loss) Income</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>00500 - Statement - Consolidated Statements Of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/StatementConsolidatedStatementsOfCashFlows</Role>
      <ShortName>Consolidated Statements Of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>00600 - Statement - Consolidated Statements Of Changes In Stockholders??? Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/StatementConsolidatedStatementsOfChangesInStockholdersEquity</Role>
      <ShortName>Consolidated Statements Of Changes In Stockholders??? Equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>00605 - Statement - Consolidated Statements Of Changes In Stockholders??? Equity (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/StatementConsolidatedStatementsOfChangesInStockholdersEquityParenthetical</Role>
      <ShortName>Consolidated Statements Of Changes In Stockholders??? Equity (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>10101 - Disclosure - Basis Of Presentation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureBasisOfPresentation</Role>
      <ShortName>Basis Of Presentation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>10201 - Disclosure - Use Of Estimates</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureUseOfEstimates</Role>
      <ShortName>Use Of Estimates</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>10301 - Disclosure - Earnings Per Common Share (EPS)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureEarningsPerCommonShareEps</Role>
      <ShortName>Earnings Per Common Share (EPS)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>10401 - Disclosure - Stock Based Compensation</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureStockBasedCompensation</Role>
      <ShortName>Stock Based Compensation</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>10501 - Disclosure - Fair Value Measurements</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureFairValueMeasurements</Role>
      <ShortName>Fair Value Measurements</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>10601 - Disclosure - Securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureSecurities</Role>
      <ShortName>Securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>10701 - Disclosure - Business Segments</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureBusinessSegments</Role>
      <ShortName>Business Segments</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>10801 - Disclosure - Loans, allowance for loan losses and OREO</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureLoansAllowanceForLoanLossesAndOreo</Role>
      <ShortName>Loans, allowance for loan losses and OREO</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>10901 - Disclosure - Revenue Recognition</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureRevenueRecognition</Role>
      <ShortName>Revenue Recognition</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>11001 - Disclosure - COVID-19 And Current Economic Conditions</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureCovid19AndCurrentEconomicConditions</Role>
      <ShortName>COVID-19 And Current Economic Conditions</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>11101 - Disclosure - Capital Notes and Other Borrowings</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureCapitalNotesAndOtherBorrowings</Role>
      <ShortName>Capital Notes and Other Borrowings</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>11201 - Disclosure - Acquisitions</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureAcquisitions</Role>
      <ShortName>Acquisitions</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>11301 - Disclosure - Recent Accounting Pronouncements And Other Authoritative Guidance</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureRecentAccountingPronouncementsAndOtherAuthoritativeGuidance</Role>
      <ShortName>Recent Accounting Pronouncements And Other Authoritative Guidance</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>20201 - Disclosure - Basis of Presentation (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureBasisOfPresentationPolicies</Role>
      <ShortName>Basis of Presentation (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureRecentAccountingPronouncementsAndOtherAuthoritativeGuidance</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>20202 - Disclosure - Use of Estimate (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureUseOfEstimatePolicies</Role>
      <ShortName>Use of Estimate (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureRecentAccountingPronouncementsAndOtherAuthoritativeGuidance</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>30303 - Disclosure - Earnings Per Common Share (EPS) (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureEarningsPerCommonShareEpsTables</Role>
      <ShortName>Earnings Per Common Share (EPS) (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureEarningsPerCommonShareEps</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>30503 - Disclosure - Fair Value Measurements (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsTables</Role>
      <ShortName>Fair Value Measurements (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureFairValueMeasurements</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>30603 - Disclosure - Securities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureSecuritiesTables</Role>
      <ShortName>Securities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureSecurities</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>30703 - Disclosure - Business Segments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureBusinessSegmentsTables</Role>
      <ShortName>Business Segments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureBusinessSegments</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>30803 - Disclosure - Loans And Allowance For Loan Losses OREO (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureLoansAndAllowanceForLoanLossesOreoTables</Role>
      <ShortName>Loans And Allowance For Loan Losses OREO (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>28</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>40101 - Disclosure - Basis of Presentation (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureBasisOfPresentationNarrativeDetails</Role>
      <ShortName>Basis of Presentation (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureBasisOfPresentationPolicies</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>40301 - Disclosure - Earnings Per Common Share (EPS) (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureEarningsPerCommonShareEpsNarrativeDetails</Role>
      <ShortName>Earnings Per Common Share (EPS) (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureEarningsPerCommonShareEpsTables</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>40302 - Disclosure - Earnings Per Common Share (EPS) (Earnings Per Share) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureEarningsPerCommonShareEpsEarningsPerShareDetails</Role>
      <ShortName>Earnings Per Common Share (EPS) (Earnings Per Share) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureEarningsPerCommonShareEpsTables</ParentRole>
      <Position>31</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>40401 - Disclosure - Stock-Based Compensation (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureStockBasedCompensationNarrativeDetails</Role>
      <ShortName>Stock-Based Compensation (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>40501 - Disclosure - Fair Value Measurements (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsNarrativeDetails</Role>
      <ShortName>Fair Value Measurements (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsTables</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>40502 - Disclosure - Fair Value Measurements (Fair Value Assets Measured On Recurring Basis) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsFairValueAssetsMeasuredOnRecurringBasisDetails</Role>
      <ShortName>Fair Value Measurements (Fair Value Assets Measured On Recurring Basis) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsTables</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>40503 - Disclosure - Fair Value Measurements (Quantitative information about Level 3 Fair Value Measurements - Recurring) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsQuantitativeInformationAboutLevel3FairValueMeasurementsRecurringDetails</Role>
      <ShortName>Fair Value Measurements (Quantitative information about Level 3 Fair Value Measurements - Recurring) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsTables</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>40504 - Disclosure - Fair Value Measurements (Impaired Loans And Other Real Estate Owned Measured At Fair Value On A Nonrecurring Basis) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsImpairedLoansAndOtherRealEstateOwnedMeasuredAtFairValueOnNonrecurringBasisDetails</Role>
      <ShortName>Fair Value Measurements (Impaired Loans And Other Real Estate Owned Measured At Fair Value On A Nonrecurring Basis) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsTables</ParentRole>
      <Position>36</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>40505 - Disclosure - Fair Value Measurements (Information Regarding Quantitative Inputs Used To Value Assets Classified As Level 3 - Nonrecurring) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsInformationRegardingQuantitativeInputsUsedToValueAssetsClassifiedAsLevel3NonrecurringDetails</Role>
      <ShortName>Fair Value Measurements (Information Regarding Quantitative Inputs Used To Value Assets Classified As Level 3 - Nonrecurring) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsTables</ParentRole>
      <Position>37</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>40506 - Disclosure - Fair Value Measurements (Fair Value Carrying And Notional Amounts) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsFairValueCarryingAndNotionalAmountsDetails</Role>
      <ShortName>Fair Value Measurements (Fair Value Carrying And Notional Amounts) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureFairValueMeasurementsTables</ParentRole>
      <Position>38</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>40601 - Disclosure - Securities (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureSecuritiesNarrativeDetails</Role>
      <ShortName>Securities (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureSecuritiesTables</ParentRole>
      <Position>39</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>40602 - Disclosure - Securities (Summary Of Securities Held-To-Maturity And Securities Available-For-Sale) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureSecuritiesSummaryOfSecuritiesHeldToMaturityAndSecuritiesAvailableForSaleDetails</Role>
      <ShortName>Securities (Summary Of Securities Held-To-Maturity And Securities Available-For-Sale) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureSecuritiesTables</ParentRole>
      <Position>40</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>40603 - Disclosure - Securities (Gross Unrealized Losses And Fair Value Of The Bank???s Investments) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureSecuritiesGrossUnrealizedLossesAndFairValueOfBanksInvestmentsDetails</Role>
      <ShortName>Securities (Gross Unrealized Losses And Fair Value Of The Bank???s Investments) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureSecuritiesTables</ParentRole>
      <Position>41</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>40604 - Disclosure - Securities (Contractual Maturities Of Investment Securities) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureSecuritiesContractualMaturitiesOfInvestmentSecuritiesDetails</Role>
      <ShortName>Securities (Contractual Maturities Of Investment Securities) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureSecuritiesTables</ParentRole>
      <Position>42</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>40701 - Disclosure - Business Segments (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureBusinessSegmentsNarrativeDetails</Role>
      <ShortName>Business Segments (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureBusinessSegmentsTables</ParentRole>
      <Position>43</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>40702 - Disclosure - Business Segments (Schedule Of Segment Reporting Information, By Segment) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureBusinessSegmentsScheduleOfSegmentReportingInformationBySegmentDetails</Role>
      <ShortName>Business Segments (Schedule Of Segment Reporting Information, By Segment) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureBusinessSegmentsTables</ParentRole>
      <Position>44</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>40801 - Disclosure - Loans, Allowance For Loan Losses And OREO (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureLoansAllowanceForLoanLossesAndOreoNarrativeDetails</Role>
      <ShortName>Loans, Allowance For Loan Losses And OREO (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>40802 - Disclosure - Loans, Allowance For Loan Losses And OREO (Summary Of Loans, Net) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureLoansAllowanceForLoanLossesAndOreoSummaryOfLoansNetDetails</Role>
      <ShortName>Loans, Allowance For Loan Losses And OREO (Summary Of Loans, Net) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>40803 - Disclosure - Loans, Allowance For Loan Losses And OREO (Loans On Non-Accrual Status) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureLoansAllowanceForLoanLossesAndOreoLoansOnNonAccrualStatusDetails</Role>
      <ShortName>Loans, Allowance For Loan Losses And OREO (Loans On Non-Accrual Status) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>40804 - Disclosure - Loans, Allowance For Loan Losses And OREO (Changes In OREO Balance) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureLoansAllowanceForLoanLossesAndOreoChangesInOreoBalanceDetails</Role>
      <ShortName>Loans, Allowance For Loan Losses And OREO (Changes In OREO Balance) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>40805 - Disclosure - Loans, Allowance For Loan Losses And OREO (Impaired Loans) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureLoansAllowanceForLoanLossesAndOreoImpairedLoansDetails</Role>
      <ShortName>Loans, Allowance For Loan Losses And OREO (Impaired Loans) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>40806 - Disclosure - Loans, Allowance For Loan Losses And OREO (Allowance For Loan Losses And Recorded Investment In Loans) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureLoansAllowanceForLoanLossesAndOreoAllowanceForLoanLossesAndRecordedInvestmentInLoansDetails</Role>
      <ShortName>Loans, Allowance For Loan Losses And OREO (Allowance For Loan Losses And Recorded Investment In Loans) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>40807 - Disclosure - Loans, Allowance For Loan Losses And OREO (Credit Quality Information-By Class) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureLoansAllowanceForLoanLossesAndOreoCreditQualityInformationByClassDetails</Role>
      <ShortName>Loans, Allowance For Loan Losses And OREO (Credit Quality Information-By Class) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>40808 - Disclosure - Loans, Allowance For Loan Losses And OREO (Age Analysis Of Past Due Financing Receivables) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureLoansAllowanceForLoanLossesAndOreoAgeAnalysisOfPastDueFinancingReceivablesDetails</Role>
      <ShortName>Loans, Allowance For Loan Losses And OREO (Age Analysis Of Past Due Financing Receivables) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>41101 - Disclosure - Capital Notes and Other Borrowings (Narrative) (Details)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureCapitalNotesAndOtherBorrowingsNarrativeDetails</Role>
      <ShortName>Capital Notes and Other Borrowings (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureCapitalNotesAndOtherBorrowings</ParentRole>
      <Position>53</Position>
    </Report>
    <Report instance="botj-20220630x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>41201 - Disclosure - Acquisitions (Narrative) (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.bankofthejames.com/role/DisclosureAcquisitionsNarrativeDetails</Role>
      <ShortName>Acquisitions (Narrative) (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.bankofthejames.com/role/DisclosureAcquisitions</ParentRole>
      <Position>54</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File doctype="10-Q" original="botj-20220630x10q.htm">botj-20220630x10q.htm</File>
    <File>botj-20220630.xsd</File>
    <File>botj-20220630_cal.xml</File>
    <File>botj-20220630_def.xml</File>
    <File>botj-20220630_lab.xml</File>
    <File>botj-20220630_pre.xml</File>
    <File>botj-20220630xex31_1.htm</File>
    <File>botj-20220630xex31_2.htm</File>
    <File>botj-20220630xex32_1.htm</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="1247">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>
