<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.22.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>315</ContextCount>
  <ElementCount>372</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>78</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>7</UnitCount>
  <MyReports>
    <Report instance="pfis-20220331x10q.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.peoplesfinancial.com/role/DocumentDocumentAndEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>00100 - Statement - Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/StatementConsolidatedBalanceSheets</Role>
      <ShortName>Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="pfis-20220331x10q.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.peoplesfinancial.com/role/StatementConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>00200 - Statement - Consolidated Statements of Income and Comprehensive Income (Loss)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/StatementConsolidatedStatementsOfIncomeAndComprehensiveIncomeLoss</Role>
      <ShortName>Consolidated Statements of Income and Comprehensive Income (Loss)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>00300 - Statement - Consolidated Statements of Changes in Stockholders' Equity</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/StatementConsolidatedStatementsOfChangesInStockholdersEquity</Role>
      <ShortName>Consolidated Statements of Changes in Stockholders' Equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>00305 - Statement - Consolidated Statements of Changes in Stockholders' Equity (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/StatementConsolidatedStatementsOfChangesInStockholdersEquityParenthetical</Role>
      <ShortName>Consolidated Statements of Changes in Stockholders' Equity (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>00400 - Statement - Consolidated Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/StatementConsolidatedStatementsOfCashFlows</Role>
      <ShortName>Consolidated Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>10101 - Disclosure - Summary of significant accounting policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureSummaryOfSignificantAccountingPolicies</Role>
      <ShortName>Summary of significant accounting policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>10201 - Disclosure - Other comprehensive loss</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureOtherComprehensiveLoss</Role>
      <ShortName>Other comprehensive loss</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>10301 - Disclosure - Earnings per share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureEarningsPerShare</Role>
      <ShortName>Earnings per share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>10401 - Disclosure - Investment securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecurities</Role>
      <ShortName>Investment securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>10501 - Disclosure - Loans, net and allowance for loan losses</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLosses</Role>
      <ShortName>Loans, net and allowance for loan losses</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>10601 - Disclosure - Other assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureOtherAssets</Role>
      <ShortName>Other assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>10701 - Disclosure - Fair value estimates</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureFairValueEstimates</Role>
      <ShortName>Fair value estimates</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>10801 - Disclosure - Employee benefit plans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureEmployeeBenefitPlans</Role>
      <ShortName>Employee benefit plans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>10901 - Disclosure - Derivatives and hedging activities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureDerivativesAndHedgingActivities</Role>
      <ShortName>Derivatives and hedging activities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>11001 - Disclosure - Deposits</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureDeposits</Role>
      <ShortName>Deposits</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>11101 - Disclosure - Borrowings</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureBorrowings</Role>
      <ShortName>Borrowings</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>11201 - Disclosure - Subordinated debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureSubordinatedDebt</Role>
      <ShortName>Subordinated debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>11301 - Disclosure - Income taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureIncomeTaxes</Role>
      <ShortName>Income taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>20102 - Disclosure - Summary of significant accounting policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureSummaryOfSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Summary of significant accounting policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>30203 - Disclosure - Other comprehensive income (loss) (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureOtherComprehensiveIncomeLossTables</Role>
      <ShortName>Other comprehensive income (loss) (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>30303 - Disclosure - Earnings per share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureEarningsPerShareTables</Role>
      <ShortName>Earnings per share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureEarningsPerShare</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>30403 - Disclosure - Investment securities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecuritiesTables</Role>
      <ShortName>Investment securities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecurities</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>30503 - Disclosure - Loans, net and allowance for loan losses (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLossesTables</Role>
      <ShortName>Loans, net and allowance for loan losses (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLosses</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>30603 - Disclosure - Other assets (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureOtherAssetsTables</Role>
      <ShortName>Other assets (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureOtherAssets</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>30703 - Disclosure - Fair value estimates (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureFairValueEstimatesTables</Role>
      <ShortName>Fair value estimates (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureFairValueEstimates</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>30803 - Disclosure - Employee benefit plans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureEmployeeBenefitPlansTables</Role>
      <ShortName>Employee benefit plans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureEmployeeBenefitPlans</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>30903 - Disclosure - Derivatives and hedging activities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureDerivativesAndHedgingActivitiesTables</Role>
      <ShortName>Derivatives and hedging activities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureDerivativesAndHedgingActivities</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>31003 - Disclosure - Deposits (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureDepositsTables</Role>
      <ShortName>Deposits (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureDeposits</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>31103 - Disclosure - Borrowings (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureBorrowingsTables</Role>
      <ShortName>Borrowings (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureBorrowings</ParentRole>
      <Position>31</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>40101 - Disclosure - Summary of significant accounting policies - Nature of operations and Basis of presentation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureSummaryOfSignificantAccountingPoliciesNatureOfOperationsAndBasisOfPresentationDetails</Role>
      <ShortName>Summary of significant accounting policies - Nature of operations and Basis of presentation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>40201 - Disclosure - Other comprehensive loss - Components of Accumulated Other Comprehensive Loss (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureOtherComprehensiveLossComponentsOfAccumulatedOtherComprehensiveLossDetails</Role>
      <ShortName>Other comprehensive loss - Components of Accumulated Other Comprehensive Loss (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>40301 - Disclosure - Earnings per share - Schedule of Earnings per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureEarningsPerShareScheduleOfEarningsPerShareDetails</Role>
      <ShortName>Earnings per share - Schedule of Earnings per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>34</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>40401 - Disclosure - Investment securities - Amortized Cost and Fair Value of Investment Securities Aggregated by Investment Category (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecuritiesAmortizedCostAndFairValueOfInvestmentSecuritiesAggregatedByInvestmentCategoryDetails</Role>
      <ShortName>Investment securities - Amortized Cost and Fair Value of Investment Securities Aggregated by Investment Category (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>35</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>40402 - Disclosure - Investment securities - Equity Securities Portfolio (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecuritiesEquitySecuritiesPortfolioDetails</Role>
      <ShortName>Investment securities - Equity Securities Portfolio (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>40403 - Disclosure - Investment securities - Maturity Distribution of Debt Securities Classified as Available-for-Sale (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecuritiesMaturityDistributionOfDebtSecuritiesClassifiedAsAvailableForSaleDetails</Role>
      <ShortName>Investment securities - Maturity Distribution of Debt Securities Classified as Available-for-Sale (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>40404 - Disclosure - Investment securities - Summary of Amortized Cost and Fair Value of Securities by Contractual Maturity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecuritiesSummaryOfAmortizedCostAndFairValueOfSecuritiesByContractualMaturityDetails</Role>
      <ShortName>Investment securities - Summary of Amortized Cost and Fair Value of Securities by Contractual Maturity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>40405 - Disclosure - Investment securities - Pledged Securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecuritiesPledgedSecuritiesDetails</Role>
      <ShortName>Investment securities - Pledged Securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>39</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>40406 - Disclosure - Investment securities - Fair Value and Unrealized Losses of Investment Securities in Continuous Unrealized Loss Position (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecuritiesFairValueAndUnrealizedLossesOfInvestmentSecuritiesInContinuousUnrealizedLossPositionDetails</Role>
      <ShortName>Investment securities - Fair Value and Unrealized Losses of Investment Securities in Continuous Unrealized Loss Position (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>40407 - Disclosure - Investment securities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecuritiesDetails</Role>
      <ShortName>Investment securities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureInvestmentSecuritiesTables</ParentRole>
      <Position>41</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>40501 - Disclosure - Loans, net and allowance for loan losses - Net Deferred Loan Costs (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLossesNetDeferredLoanCostsDetails</Role>
      <ShortName>Loans, net and allowance for loan losses - Net Deferred Loan Costs (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>42</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>40502 - Disclosure - Loans, net and allowance for loan losses - Major Classifications of Loans Outstanding (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLossesMajorClassificationsOfLoansOutstandingDetails</Role>
      <ShortName>Loans, net and allowance for loan losses - Major Classifications of Loans Outstanding (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>40503 - Disclosure - Loans, net and allowance for loan losses - Changes in Allowance for Loan Losses Account by Major Classification of Loans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLossesChangesInAllowanceForLoanLossesAccountByMajorClassificationOfLoansDetails</Role>
      <ShortName>Loans, net and allowance for loan losses - Changes in Allowance for Loan Losses Account by Major Classification of Loans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>40504 - Disclosure - Loans, net and allowance for loan losses - Allocation of Allowance for Loan Losses and Related Loans by Major Classification of Loans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLossesAllocationOfAllowanceForLoanLossesAndRelatedLoansByMajorClassificationOfLoansDetails</Role>
      <ShortName>Loans, net and allowance for loan losses - Allocation of Allowance for Loan Losses and Related Loans by Major Classification of Loans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>40505 - Disclosure - Loans, net and allowance for loan losses - Major Classification of Loans Portfolio Summarized by Credit Quality (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLossesMajorClassificationOfLoansPortfolioSummarizedByCreditQualityDetails</Role>
      <ShortName>Loans, net and allowance for loan losses - Major Classification of Loans Portfolio Summarized by Credit Quality (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>40506 - Disclosure - Loans, net and allowance for loan losses - Information Concerning Nonaccrual Loans by Major Loan Classification (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLossesInformationConcerningNonaccrualLoansByMajorLoanClassificationDetails</Role>
      <ShortName>Loans, net and allowance for loan losses - Information Concerning Nonaccrual Loans by Major Loan Classification (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>40507 - Disclosure - Loans, net and allowance for loan losses - Major Classification of Loans by Past Due Status (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLossesMajorClassificationOfLoansByPastDueStatusDetails</Role>
      <ShortName>Loans, net and allowance for loan losses - Major Classification of Loans by Past Due Status (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>40508 - Disclosure - Loans, net and allowance for loan losses - Summarized Information in Concerning to Impaired Loans (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLossesSummarizedInformationInConcerningToImpairedLoansDetails</Role>
      <ShortName>Loans, net and allowance for loan losses - Summarized Information in Concerning to Impaired Loans (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>40509 - Disclosure - Loans, net and allowance for loan losses - Loan Modifications and Troubled Debt Restructurings (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureLoansNetAndAllowanceForLoanLossesLoanModificationsAndTroubledDebtRestructuringsDetails</Role>
      <ShortName>Loans, net and allowance for loan losses - Loan Modifications and Troubled Debt Restructurings (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>40601 - Disclosure - Other assets - Components of Other Assets (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureOtherAssetsComponentsOfOtherAssetsDetails</Role>
      <ShortName>Other assets - Components of Other Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>40701 - Disclosure - Fair value estimates - Transfers Between Levels (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureFairValueEstimatesTransfersBetweenLevelsDetails</Role>
      <ShortName>Fair value estimates - Transfers Between Levels (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>40702 - Disclosure - Fair value estimates - Schedule of Assets and Liabilities Measured at Fair Value on Recurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureFairValueEstimatesScheduleOfAssetsAndLiabilitiesMeasuredAtFairValueOnRecurringBasisDetails</Role>
      <ShortName>Fair value estimates - Schedule of Assets and Liabilities Measured at Fair Value on Recurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>40703 - Disclosure - Fair value estimates - Schedule of Assets and Liabilities Measured at Fair Value on Nonrecurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureFairValueEstimatesScheduleOfAssetsAndLiabilitiesMeasuredAtFairValueOnNonrecurringBasisDetails</Role>
      <ShortName>Fair value estimates - Schedule of Assets and Liabilities Measured at Fair Value on Nonrecurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>40704 - Disclosure - Fair value estimates - Additional Quantitative Information about Assets Measured at Fair Value on Nonrecurring Basis (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureFairValueEstimatesAdditionalQuantitativeInformationAboutAssetsMeasuredAtFairValueOnNonrecurringBasisDetails</Role>
      <ShortName>Fair value estimates - Additional Quantitative Information about Assets Measured at Fair Value on Nonrecurring Basis (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>40705 - Disclosure - Fair value estimates - Carrying and Fair Values of Financial Instruments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureFairValueEstimatesCarryingAndFairValuesOfFinancialInstrumentsDetails</Role>
      <ShortName>Fair value estimates - Carrying and Fair Values of Financial Instruments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>40801 - Disclosure - Employee benefit plans - Components of Net Periodic Benefit Cost (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureEmployeeBenefitPlansComponentsOfNetPeriodicBenefitCostDetail</Role>
      <ShortName>Employee benefit plans - Components of Net Periodic Benefit Cost (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>40802 - Disclosure - Employee benefit plans - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureEmployeeBenefitPlansAdditionalInformationDetails</Role>
      <ShortName>Employee benefit plans - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>40901 - Disclosure - Derivatives and hedging activities - Fair Values of Derivative Instruments on the Balance Sheet (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureDerivativesAndHedgingActivitiesFairValuesOfDerivativeInstrumentsOnBalanceSheetDetails</Role>
      <ShortName>Derivatives and hedging activities - Fair Values of Derivative Instruments on the Balance Sheet (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>40902 - Disclosure - Derivatives and hedging activities - Effect of Fair Value and Cash Flow Hedge Accounting on Accumulated Other Comprehensive Income (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureDerivativesAndHedgingActivitiesEffectOfFairValueAndCashFlowHedgeAccountingOnAccumulatedOtherComprehensiveIncomeDetails</Role>
      <ShortName>Derivatives and hedging activities - Effect of Fair Value and Cash Flow Hedge Accounting on Accumulated Other Comprehensive Income (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>40903 - Disclosure - Derivatives and hedging activities - Effect of Fair Value and Cash Flow Hedge Accounting on the Income Statement (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureDerivativesAndHedgingActivitiesEffectOfFairValueAndCashFlowHedgeAccountingOnIncomeStatementDetails</Role>
      <ShortName>Derivatives and hedging activities - Effect of Fair Value and Cash Flow Hedge Accounting on the Income Statement (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>40904 - Disclosure - Derivatives and hedging activities - Effect of Other Derivative Instruments on the Income Statement (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureDerivativesAndHedgingActivitiesEffectOfOtherDerivativeInstrumentsOnIncomeStatementDetails</Role>
      <ShortName>Derivatives and hedging activities - Effect of Other Derivative Instruments on the Income Statement (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>40905 - Disclosure - Derivatives and hedging activities - Offsetting Derivatives (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureDerivativesAndHedgingActivitiesOffsettingDerivativesDetails</Role>
      <ShortName>Derivatives and hedging activities - Offsetting Derivatives (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>41001 - Disclosure - Deposits - Components of Interest-bearing and Noninterest-bearing Deposits (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureDepositsComponentsOfInterestBearingAndNoninterestBearingDepositsDetails</Role>
      <ShortName>Deposits - Components of Interest-bearing and Noninterest-bearing Deposits (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>64</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R65.htm</HtmlFileName>
      <LongName>41101 - Disclosure - Borrowings (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureBorrowingsDetails</Role>
      <ShortName>Borrowings (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureBorrowingsTables</ParentRole>
      <Position>65</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R66.htm</HtmlFileName>
      <LongName>41102 - Disclosure - Borrowings - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureBorrowingsAdditionalInformationDetails</Role>
      <ShortName>Borrowings - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>66</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R67.htm</HtmlFileName>
      <LongName>41103 - Disclosure - Borrowings - Long-term debt advances (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureBorrowingsLongTermDebtAdvancesDetails</Role>
      <ShortName>Borrowings - Long-term debt advances (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>67</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R68.htm</HtmlFileName>
      <LongName>41104 - Disclosure - Borrowings - Maturities of long-term debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureBorrowingsMaturitiesOfLongTermDebtDetails</Role>
      <ShortName>Borrowings - Maturities of long-term debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>68</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R69.htm</HtmlFileName>
      <LongName>41201 - Disclosure - Subordinated debt (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureSubordinatedDebtDetails</Role>
      <ShortName>Subordinated debt (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureSubordinatedDebt</ParentRole>
      <Position>69</Position>
    </Report>
    <Report instance="pfis-20220331x10q.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R70.htm</HtmlFileName>
      <LongName>41301 - Disclosure - Income taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.peoplesfinancial.com/role/DisclosureIncomeTaxesDetails</Role>
      <ShortName>Income taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.peoplesfinancial.com/role/DisclosureIncomeTaxes</ParentRole>
      <Position>70</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="pfis-20220331x10q.htm">pfis-20220331x10q.htm</File>
    <File>pfis-20220331.xsd</File>
    <File>pfis-20220331_cal.xml</File>
    <File>pfis-20220331_def.xml</File>
    <File>pfis-20220331_lab.xml</File>
    <File>pfis-20220331_pre.xml</File>
    <File>pfis-20220331xex31d1.htm</File>
    <File>pfis-20220331xex31d2.htm</File>
    <File>pfis-20220331xex32.htm</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy items="1277">http://fasb.org/us-gaap/2021-01-31</BaseTaxonomy>
    <BaseTaxonomy items="29">http://xbrl.sec.gov/dei/2021q4</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
