<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.10.0.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>324</ContextCount>
  <ElementCount>309</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>72</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>7</UnitCount>
  <MyReports>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>00090 - Document - Document and Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DocumentDocumentAndEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>00100 - Statement - Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/StatementConsolidatedBalanceSheets</Role>
      <ShortName>Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>00105 - Statement - Consolidated Balance Sheets (Parenthetical)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/StatementConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Consolidated Balance Sheets (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>00200 - Statement - Consolidated Statements of Income and Comprehensive Income</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/StatementConsolidatedStatementsOfIncomeAndComprehensiveIncome</Role>
      <ShortName>Consolidated Statements of Income and Comprehensive Income</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <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://imetrix.edgar-online.com/role/StatementConsolidatedStatementsOfChangesInStockholdersEquity</Role>
      <ShortName>Consolidated Statements of Changes in Stockholders' Equity</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <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://imetrix.edgar-online.com/role/StatementConsolidatedStatementsOfChangesInStockholdersEquityParenthetical</Role>
      <ShortName>Consolidated Statements of Changes in Stockholders' Equity (Parenthetical)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>00400 - Statement - Consolidated Statements of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/StatementConsolidatedStatementsOfCashFlows</Role>
      <ShortName>Consolidated Statements of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>10101 - Disclosure - Summary of significant accounting policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureSummaryOfSignificantAccountingPolicies</Role>
      <ShortName>Summary of significant accounting policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>10201 - Disclosure - Other comprehensive loss</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureOtherComprehensiveLoss</Role>
      <ShortName>Other comprehensive loss</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>10301 - Disclosure - Earnings per share</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureEarningsPerShare</Role>
      <ShortName>Earnings per share</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>10401 - Disclosure - Investment securities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureInvestmentSecurities</Role>
      <ShortName>Investment securities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <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://imetrix.edgar-online.com/role/DisclosureLoansNetAndAllowanceForLoanLosses</Role>
      <ShortName>Loans, net and allowance for loan losses</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>10601 - Disclosure - Other assets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureOtherAssets</Role>
      <ShortName>Other assets</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>10701 - Disclosure - Fair value estimates</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureFairValueEstimates</Role>
      <ShortName>Fair value estimates</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>10801 - Disclosure - Employee benefit plans</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureEmployeeBenefitPlans</Role>
      <ShortName>Employee benefit plans</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>10901 - Disclosure - Derivatives and hedging activities</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureDerivativesAndHedgingActivities</Role>
      <ShortName>Derivatives and hedging activities</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>11001 - Disclosure - Short-term borrowings</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureShortTermBorrowings</Role>
      <ShortName>Short-term borrowings</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>11101 - Disclosure - Income taxes</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureIncomeTaxes</Role>
      <ShortName>Income taxes</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>20102 - Disclosure - Summary of significant accounting policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureSummaryOfSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Summary of significant accounting policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>30203 - Disclosure - Other comprehensive loss (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureOtherComprehensiveLossTables</Role>
      <ShortName>Other comprehensive loss (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://imetrix.edgar-online.com/role/DisclosureOtherComprehensiveLoss</ParentRole>
      <Position>20</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>30303 - Disclosure - Earnings per share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureEarningsPerShareTables</Role>
      <ShortName>Earnings per share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://imetrix.edgar-online.com/role/DisclosureEarningsPerShare</ParentRole>
      <Position>21</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>30403 - Disclosure - Investment securities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureInvestmentSecuritiesTables</Role>
      <ShortName>Investment securities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://imetrix.edgar-online.com/role/DisclosureInvestmentSecurities</ParentRole>
      <Position>22</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>30503 - Disclosure - Loans, net and allowance for loan losses (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureLoansNetAndAllowanceForLoanLossesTables</Role>
      <ShortName>Loans, net and allowance for loan losses (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://imetrix.edgar-online.com/role/DisclosureLoansNetAndAllowanceForLoanLosses</ParentRole>
      <Position>23</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>30603 - Disclosure - Other assets (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureOtherAssetsTables</Role>
      <ShortName>Other assets (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://imetrix.edgar-online.com/role/DisclosureOtherAssets</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>30703 - Disclosure - Fair value estimates (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureFairValueEstimatesTables</Role>
      <ShortName>Fair value estimates (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://imetrix.edgar-online.com/role/DisclosureFairValueEstimates</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>30803 - Disclosure - Employee benefit plans (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureEmployeeBenefitPlansTables</Role>
      <ShortName>Employee benefit plans (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://imetrix.edgar-online.com/role/DisclosureEmployeeBenefitPlans</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>30903 - Disclosure - Derivatives and hedging activities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureDerivativesAndHedgingActivitiesTables</Role>
      <ShortName>Derivatives and hedging activities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://imetrix.edgar-online.com/role/DisclosureDerivativesAndHedgingActivities</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>31003 - Disclosure - Short-term borrowings (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureShortTermBorrowingsTables</Role>
      <ShortName>Short-term borrowings (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://imetrix.edgar-online.com/role/DisclosureShortTermBorrowings</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>40101 - Disclosure - Summary of significant accounting policies - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureSummaryOfSignificantAccountingPoliciesAdditionalInformationDetails</Role>
      <ShortName>Summary of significant accounting policies - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>29</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>40102 - Disclosure - Summary of significant accounting policies - Income Taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureSummaryOfSignificantAccountingPoliciesIncomeTaxesDetails</Role>
      <ShortName>Summary of significant accounting policies - Income Taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>30</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>40201 - Disclosure - Other comprehensive loss - Components of Accumulated Other Comprehensive Loss (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureOtherComprehensiveLossComponentsOfAccumulatedOtherComprehensiveLossDetails</Role>
      <ShortName>Other comprehensive loss - Components of Accumulated Other Comprehensive Loss (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>40202 - Disclosure - Other comprehensive loss - Other Comprehensive Loss and Related Tax Effects (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureOtherComprehensiveLossOtherComprehensiveLossAndRelatedTaxEffectsDetails</Role>
      <ShortName>Other comprehensive loss - Other Comprehensive Loss and Related Tax Effects (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>32</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>40301 - Disclosure - Earnings per share - Shares Considered Anti-dilutive (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureEarningsPerShareSharesConsideredAntiDilutiveDetails</Role>
      <ShortName>Earnings per share - Shares Considered Anti-dilutive (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>33</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>40302 - Disclosure - Earnings per share - Schedule of Earnings per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.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-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>40402 - Disclosure - Investment securities - Unrealized and realized gains and losses (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureInvestmentSecuritiesUnrealizedAndRealizedGainsAndLossesDetails</Role>
      <ShortName>Investment securities - Unrealized and realized gains and losses (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>36</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>40403 - Disclosure - Investment securities - Restricted Investment In Stock (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureInvestmentSecuritiesRestrictedInvestmentInStockDetails</Role>
      <ShortName>Investment securities - Restricted Investment In Stock (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>40404 - Disclosure - Investment securities - Maturity Distribution of Debt Securities Classified as Available-for-Sale (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureInvestmentSecuritiesMaturityDistributionOfDebtSecuritiesClassifiedAsAvailableForSaleDetails</Role>
      <ShortName>Investment securities - Maturity Distribution of Debt Securities Classified as Available-for-Sale (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>40405 - Disclosure - Investment securities - Summary of Amortized Cost and Fair Value of Securities by Contractual Maturity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.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>39</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>40407 - Disclosure - Investment securities - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureInvestmentSecuritiesAdditionalInformationDetails</Role>
      <ShortName>Investment securities - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>40509 - Disclosure - Loans, net and allowance for loan losses - Loans Modified Resulting in Troubled Debt Restructurings (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureLoansNetAndAllowanceForLoanLossesLoansModifiedResultingInTroubledDebtRestructuringsDetails</Role>
      <ShortName>Loans, net and allowance for loan losses - Loans Modified Resulting in Troubled Debt Restructurings (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <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://imetrix.edgar-online.com/role/DisclosureOtherAssetsComponentsOfOtherAssetsDetails</Role>
      <ShortName>Other assets - Components of Other Assets (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.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://imetrix.edgar-online.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>52</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.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://imetrix.edgar-online.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>53</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.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://imetrix.edgar-online.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>54</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>40705 - Disclosure - Fair value estimates - Carrying and Fair Values of Financial Instruments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureFairValueEstimatesCarryingAndFairValuesOfFinancialInstrumentsDetails</Role>
      <ShortName>Fair value estimates - Carrying and Fair Values of Financial Instruments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>40801 - Disclosure - Employee benefit plans - Components of Net Periodic Benefit Cost (Detail)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureEmployeeBenefitPlansComponentsOfNetPeriodicBenefitCostDetail</Role>
      <ShortName>Employee benefit plans - Components of Net Periodic Benefit Cost (Detail)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>40802 - Disclosure - Employee benefit plans - Salaries and Employee Benefits Expense - Profit Sharing (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureEmployeeBenefitPlansSalariesAndEmployeeBenefitsExpenseProfitSharingDetails</Role>
      <ShortName>Employee benefit plans - Salaries and Employee Benefits Expense - Profit Sharing (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>40803 - Disclosure - Employee benefit plans - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureEmployeeBenefitPlansAdditionalInformationDetails</Role>
      <ShortName>Employee benefit plans - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>58</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <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://imetrix.edgar-online.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-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>40902 - Disclosure - Derivatives and hedging activities - Effect of Derivative Instruments on the Income Statement (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureDerivativesAndHedgingActivitiesEffectOfDerivativeInstrumentsOnIncomeStatementDetails</Role>
      <ShortName>Derivatives and hedging activities - Effect of Derivative Instruments on the Income Statement (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>40903 - Disclosure - Derivatives and hedging activities - Credit-risk-related Contingent Features (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureDerivativesAndHedgingActivitiesCreditRiskRelatedContingentFeaturesDetails</Role>
      <ShortName>Derivatives and hedging activities - Credit-risk-related Contingent Features (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>61</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>41001 - Disclosure - Short-term borrowings - Summary of Short-term Borrowings (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureShortTermBorrowingsSummaryOfShortTermBorrowingsDetails</Role>
      <ShortName>Short-term borrowings - Summary of Short-term Borrowings (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>62</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R63.htm</HtmlFileName>
      <LongName>41002 - Disclosure - Short-term borrowings - Additional Information (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureShortTermBorrowingsAdditionalInformationDetails</Role>
      <ShortName>Short-term borrowings - Additional Information (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>63</Position>
    </Report>
    <Report instance="pfis-20180930.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R64.htm</HtmlFileName>
      <LongName>41103 - Disclosure - Income taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://imetrix.edgar-online.com/role/DisclosureIncomeTaxesDetails</Role>
      <ShortName>Income taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://imetrix.edgar-online.com/role/DisclosureIncomeTaxes</ParentRole>
      <Position>64</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File>pfis-20180930.xml</File>
    <File>pfis-20180930.xsd</File>
    <File>pfis-20180930_cal.xml</File>
    <File>pfis-20180930_def.xml</File>
    <File>pfis-20180930_lab.xml</File>
    <File>pfis-20180930_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy>http://fasb.org/us-gaap/2018-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/invest/2013-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/dei/2018-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/srt/2018-01-31</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
