<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.20.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>153</ContextCount>
  <ElementCount>399</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>43</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>4</UnitCount>
  <MyReports>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>0001000 - Document - DEI Document</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/DeiDocument</Role>
      <ShortName>DEI Document</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>1001000 - Statement - Consolidated Balance Sheets</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/ConsolidatedBalanceSheets</Role>
      <ShortName>Consolidated Balance Sheets</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>1001001 - Statement - Consolidated Balance Sheets Parenthetical</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/ConsolidatedBalanceSheetsParenthetical</Role>
      <ShortName>Consolidated Balance Sheets Parenthetical</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R4.htm</HtmlFileName>
      <LongName>1002000 - Statement - Consolidated Statements of Operations and Comprehensive Loss</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/ConsolidatedStatementsOfOperationsAndComprehensiveLoss</Role>
      <ShortName>Consolidated Statements of Operations and Comprehensive Loss</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>4</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R5.htm</HtmlFileName>
      <LongName>1003000 - Statement - Statements of Convertible Preferred Stock and Stockholders' Equity (Deficit)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/StatementsOfConvertiblePreferredStockAndStockholdersEquityDeficit</Role>
      <ShortName>Statements of Convertible Preferred Stock and Stockholders' Equity (Deficit)</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>5</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R6.htm</HtmlFileName>
      <LongName>1004000 - Statement - Statement of Cash Flows</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/StatementOfCashFlows</Role>
      <ShortName>Statement of Cash Flows</ShortName>
      <MenuCategory>Statements</MenuCategory>
      <Position>6</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R7.htm</HtmlFileName>
      <LongName>2101100 - Disclosure - Organization and Nature of the Business</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/OrganizationAndNatureOfBusiness</Role>
      <ShortName>Organization and Nature of the Business</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>7</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R8.htm</HtmlFileName>
      <LongName>2104100 - Disclosure - Summary of Significant Accounting Policies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/SummaryOfSignificantAccountingPolicies</Role>
      <ShortName>Summary of Significant Accounting Policies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>8</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R9.htm</HtmlFileName>
      <LongName>2107100 - Disclosure - Inventory (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.xerispharma.com/role/InventoryNotes</Role>
      <ShortName>Inventory (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>9</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R10.htm</HtmlFileName>
      <LongName>2113100 - Disclosure - Property and Equipment (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.xerispharma.com/role/PropertyAndEquipmentNotes</Role>
      <ShortName>Property and Equipment (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>10</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R11.htm</HtmlFileName>
      <LongName>2116100 - Disclosure - Other Accrued Liabilities (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.xerispharma.com/role/OtherAccruedLiabilitiesNotes</Role>
      <ShortName>Other Accrued Liabilities (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>11</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R12.htm</HtmlFileName>
      <LongName>2119100 - Disclosure - Long-Term Debt</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/LongTermDebt</Role>
      <ShortName>Long-Term Debt</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>12</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R13.htm</HtmlFileName>
      <LongName>2122100 - Disclosure - Public Stock Offerings</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/PublicStockOfferings</Role>
      <ShortName>Public Stock Offerings</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>13</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R14.htm</HtmlFileName>
      <LongName>2125100 - Disclosure - Convertible Preferred Stock</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/ConvertiblePreferredStock</Role>
      <ShortName>Convertible Preferred Stock</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>14</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R15.htm</HtmlFileName>
      <LongName>2129100 - Disclosure - Warrants (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.xerispharma.com/role/WarrantsNotes</Role>
      <ShortName>Warrants (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>15</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R16.htm</HtmlFileName>
      <LongName>2130100 - Disclosure - Commitments and Contingencies</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/CommitmentsAndContingencies</Role>
      <ShortName>Commitments and Contingencies</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>16</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R17.htm</HtmlFileName>
      <LongName>2131100 - Disclosure - Stock Compensation Plan (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.xerispharma.com/role/StockCompensationPlanNotes</Role>
      <ShortName>Stock Compensation Plan (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>17</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R18.htm</HtmlFileName>
      <LongName>2132100 - Disclosure - Fair Value Measurement</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/FairValueMeasurement</Role>
      <ShortName>Fair Value Measurement</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>18</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R19.htm</HtmlFileName>
      <LongName>2133100 - Disclosure - Available-for-Sale Investments (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.xerispharma.com/role/AvailableForSaleInvestmentsNotes</Role>
      <ShortName>Available-for-Sale Investments (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>19</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R20.htm</HtmlFileName>
      <LongName>2134100 - Disclosure - Net Loss Per Share (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.xerispharma.com/role/NetLossPerShareNotes</Role>
      <ShortName>Net Loss Per Share (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>20</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R21.htm</HtmlFileName>
      <LongName>2135100 - Disclosure - Defined Contribution Plan (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.xerispharma.com/role/DefinedContributionPlanNotes</Role>
      <ShortName>Defined Contribution Plan (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>21</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R22.htm</HtmlFileName>
      <LongName>2137100 - Disclosure - Income Taxes (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.xerispharma.com/role/IncomeTaxesNotes</Role>
      <ShortName>Income Taxes (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>22</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R23.htm</HtmlFileName>
      <LongName>2138100 - Disclosure - Subsequent Events (Notes)</LongName>
      <ReportType>Notes</ReportType>
      <Role>http://www.xerispharma.com/role/SubsequentEventsNotes</Role>
      <ShortName>Subsequent Events (Notes)</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>23</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R24.htm</HtmlFileName>
      <LongName>2204201 - Disclosure - Summary of Significant Accounting Policies (Policies)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/SummaryOfSignificantAccountingPoliciesPolicies</Role>
      <ShortName>Summary of Significant Accounting Policies (Policies)</ShortName>
      <MenuCategory>Policies</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/SummaryOfSignificantAccountingPolicies</ParentRole>
      <Position>24</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R25.htm</HtmlFileName>
      <LongName>2304302 - Disclosure - Summary of Significant Accounting Policies (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/SummaryOfSignificantAccountingPoliciesTables</Role>
      <ShortName>Summary of Significant Accounting Policies (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/SummaryOfSignificantAccountingPolicies</ParentRole>
      <Position>25</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R26.htm</HtmlFileName>
      <LongName>2307301 - Disclosure - Inventory (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/InventoryTables</Role>
      <ShortName>Inventory (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/InventoryNotes</ParentRole>
      <Position>26</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R27.htm</HtmlFileName>
      <LongName>2313301 - Disclosure - Property and Equipment (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/PropertyAndEquipmentTables</Role>
      <ShortName>Property and Equipment (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/PropertyAndEquipmentNotes</ParentRole>
      <Position>27</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R28.htm</HtmlFileName>
      <LongName>2316301 - Disclosure - Other Accrued Liabilities (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/OtherAccruedLiabilitiesTables</Role>
      <ShortName>Other Accrued Liabilities (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/OtherAccruedLiabilitiesNotes</ParentRole>
      <Position>28</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R29.htm</HtmlFileName>
      <LongName>2319301 - Disclosure - Long-Term Debt (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/LongTermDebtTables</Role>
      <ShortName>Long-Term Debt (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/LongTermDebt</ParentRole>
      <Position>29</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R30.htm</HtmlFileName>
      <LongName>2329301 - Disclosure - Warrants (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/WarrantsTables</Role>
      <ShortName>Warrants (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/WarrantsNotes</ParentRole>
      <Position>30</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R31.htm</HtmlFileName>
      <LongName>2330301 - Disclosure - Commitments and Contingencies Future Minimum Lease Payments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/CommitmentsAndContingenciesFutureMinimumLeasePaymentsTables</Role>
      <ShortName>Commitments and Contingencies Future Minimum Lease Payments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>31</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R32.htm</HtmlFileName>
      <LongName>2331301 - Disclosure - Stock Compensation Plan (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/StockCompensationPlanTables</Role>
      <ShortName>Stock Compensation Plan (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/StockCompensationPlanNotes</ParentRole>
      <Position>32</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R33.htm</HtmlFileName>
      <LongName>2332301 - Disclosure - Fair Value Measurement (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/FairValueMeasurementTables</Role>
      <ShortName>Fair Value Measurement (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/FairValueMeasurement</ParentRole>
      <Position>33</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R34.htm</HtmlFileName>
      <LongName>2333301 - Disclosure - Available-for-Sale Investments (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/AvailableForSaleInvestmentsTables</Role>
      <ShortName>Available-for-Sale Investments (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/AvailableForSaleInvestmentsNotes</ParentRole>
      <Position>34</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R35.htm</HtmlFileName>
      <LongName>2334301 - Disclosure - Net Loss Per Share (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/NetLossPerShareTables</Role>
      <ShortName>Net Loss Per Share (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/NetLossPerShareNotes</ParentRole>
      <Position>35</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R36.htm</HtmlFileName>
      <LongName>2337301 - Disclosure - Income Taxes (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/IncomeTaxesTables</Role>
      <ShortName>Income Taxes (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/IncomeTaxesNotes</ParentRole>
      <Position>36</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R37.htm</HtmlFileName>
      <LongName>2337302 - Disclosure - Income Taxes Uncertain Tax Positions (Tables)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/IncomeTaxesUncertainTaxPositionsTables</Role>
      <ShortName>Income Taxes Uncertain Tax Positions (Tables)</ShortName>
      <MenuCategory>Tables</MenuCategory>
      <Position>37</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R38.htm</HtmlFileName>
      <LongName>2401401 - Disclosure - Organization and Nature of the Business Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/OrganizationAndNatureOfBusinessNarrativeDetails</Role>
      <ShortName>Organization and Nature of the Business Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>38</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R39.htm</HtmlFileName>
      <LongName>2404403 - Disclosure - Summary of Significant Accounting Policies Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/SummaryOfSignificantAccountingPoliciesNarrativeDetails</Role>
      <ShortName>Summary of Significant Accounting Policies Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/SummaryOfSignificantAccountingPoliciesTables</ParentRole>
      <Position>39</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R40.htm</HtmlFileName>
      <LongName>2404404 - Disclosure - Summary of Significant Accounting Policies Summary of Accounting Policies (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/SummaryOfSignificantAccountingPoliciesSummaryOfAccountingPoliciesDetails</Role>
      <ShortName>Summary of Significant Accounting Policies Summary of Accounting Policies (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>40</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R41.htm</HtmlFileName>
      <LongName>2407403 - Disclosure - Inventory Components of Inventory (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/InventoryComponentsOfInventoryDetails</Role>
      <ShortName>Inventory Components of Inventory (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>41</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R42.htm</HtmlFileName>
      <LongName>2413402 - Disclosure - Property and Equipment (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/PropertyAndEquipmentDetails</Role>
      <ShortName>Property and Equipment (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/PropertyAndEquipmentTables</ParentRole>
      <Position>42</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R43.htm</HtmlFileName>
      <LongName>2413403 - Disclosure - Property and Equipment Property and equipment details (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/PropertyAndEquipmentPropertyAndEquipmentDetailsDetails</Role>
      <ShortName>Property and Equipment Property and equipment details (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>43</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R44.htm</HtmlFileName>
      <LongName>2416402 - Disclosure - Other Accrued Liabilities Other Accrued Liabilities (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/OtherAccruedLiabilitiesOtherAccruedLiabilitiesDetails</Role>
      <ShortName>Other Accrued Liabilities Other Accrued Liabilities (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>44</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R45.htm</HtmlFileName>
      <LongName>2419402 - Disclosure - Long-Term Debt Debt, Future Principal Payments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/LongTermDebtDebtFuturePrincipalPaymentsDetails</Role>
      <ShortName>Long-Term Debt Debt, Future Principal Payments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>45</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R46.htm</HtmlFileName>
      <LongName>2419403 - Disclosure - Long-Term Debt Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/LongTermDebtNarrativeDetails</Role>
      <ShortName>Long-Term Debt Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>46</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R47.htm</HtmlFileName>
      <LongName>2422401 - Disclosure - Public Stock Offerings Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/PublicStockOfferingsNarrativeDetails</Role>
      <ShortName>Public Stock Offerings Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>47</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R48.htm</HtmlFileName>
      <LongName>2425401 - Disclosure - Convertible Preferred Stock Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/ConvertiblePreferredStockNarrativeDetails</Role>
      <ShortName>Convertible Preferred Stock Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>48</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R49.htm</HtmlFileName>
      <LongName>2429402 - Disclosure - Warrants Schedule of Stockholders' Equity Note, Warrants or Rights (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/WarrantsScheduleOfStockholdersEquityNoteWarrantsOrRightsDetails</Role>
      <ShortName>Warrants Schedule of Stockholders' Equity Note, Warrants or Rights (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>49</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R50.htm</HtmlFileName>
      <LongName>2429403 - Disclosure - Warrants Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/WarrantsNarrativeDetails</Role>
      <ShortName>Warrants Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>50</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R51.htm</HtmlFileName>
      <LongName>2430402 - Disclosure - Commitments and Contingencies Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/CommitmentsAndContingenciesNarrativeDetails</Role>
      <ShortName>Commitments and Contingencies Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>51</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R52.htm</HtmlFileName>
      <LongName>2431402 - Disclosure - Stock Compensation Plan Share-based Compensation Arrangement by Share-based Payment Award, Fair Value Assumptions, Method Used (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/StockCompensationPlanShareBasedCompensationArrangementByShareBasedPaymentAwardFairValueAssumptionsMethodUsedDetails</Role>
      <ShortName>Stock Compensation Plan Share-based Compensation Arrangement by Share-based Payment Award, Fair Value Assumptions, Method Used (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>52</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R53.htm</HtmlFileName>
      <LongName>2431403 - Disclosure - Stock Compensation Plan Employee Stock Award Activity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/StockCompensationPlanEmployeeStockAwardActivityDetails</Role>
      <ShortName>Stock Compensation Plan Employee Stock Award Activity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>53</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R54.htm</HtmlFileName>
      <LongName>2431404 - Disclosure - Stock Compensation Plan Narrative (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/StockCompensationPlanNarrativeDetails</Role>
      <ShortName>Stock Compensation Plan Narrative (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>54</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R55.htm</HtmlFileName>
      <LongName>2431405 - Disclosure - Stock Compensation Plan Stock-Based Compensation Expense (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/StockCompensationPlanStockBasedCompensationExpenseDetails</Role>
      <ShortName>Stock Compensation Plan Stock-Based Compensation Expense (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>55</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R56.htm</HtmlFileName>
      <LongName>2431406 - Disclosure - Stock Compensation Plan Restricted stock units, activity (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/StockCompensationPlanRestrictedStockUnitsActivityDetails</Role>
      <ShortName>Stock Compensation Plan Restricted stock units, activity (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>56</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R57.htm</HtmlFileName>
      <LongName>2432402 - Disclosure - Fair Value Measurement Fair Value, Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/FairValueMeasurementFairValueLiabilitiesMeasuredOnRecurringBasisUnobservableInputReconciliationDetails</Role>
      <ShortName>Fair Value Measurement Fair Value, Liabilities Measured on Recurring Basis, Unobservable Input Reconciliation (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>57</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R58.htm</HtmlFileName>
      <LongName>2433402 - Disclosure - Available-for-Sale Investments (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/AvailableForSaleInvestmentsDetails</Role>
      <ShortName>Available-for-Sale Investments (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/AvailableForSaleInvestmentsTables</ParentRole>
      <Position>58</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R59.htm</HtmlFileName>
      <LongName>2434403 - Disclosure - Net Loss Per Share Antidilutive Securities Excluded from Computation of Earnings Per Share (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/NetLossPerShareAntidilutiveSecuritiesExcludedFromComputationOfEarningsPerShareDetails</Role>
      <ShortName>Net Loss Per Share Antidilutive Securities Excluded from Computation of Earnings Per Share (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>59</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R60.htm</HtmlFileName>
      <LongName>2435401 - Disclosure - Defined Contribution Plan Defined Contribution Plan (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/DefinedContributionPlanDefinedContributionPlanDetails</Role>
      <ShortName>Defined Contribution Plan Defined Contribution Plan (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <Position>60</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R61.htm</HtmlFileName>
      <LongName>2437403 - Disclosure - Income Taxes (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/IncomeTaxesDetails</Role>
      <ShortName>Income Taxes (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/IncomeTaxesTables</ParentRole>
      <Position>61</Position>
    </Report>
    <Report instance="xers-20191231.xml">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R62.htm</HtmlFileName>
      <LongName>2438402 - Disclosure - Subsequent Events (Details)</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://www.xerispharma.com/role/SubsequentEventsDetails</Role>
      <ShortName>Subsequent Events (Details)</ShortName>
      <MenuCategory>Details</MenuCategory>
      <ParentRole>http://www.xerispharma.com/role/SubsequentEventsNotes</ParentRole>
      <Position>62</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File>xers-20191231.xml</File>
    <File>xers-20191231.xsd</File>
    <File>xers-20191231_cal.xml</File>
    <File>xers-20191231_def.xml</File>
    <File>xers-20191231_lab.xml</File>
    <File>xers-20191231_pre.xml</File>
  </InputFiles>
  <SupplementalFiles/>
  <BaseTaxonomies>
    <BaseTaxonomy>http://fasb.org/us-gaap/2019-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://fasb.org/srt/2019-01-31</BaseTaxonomy>
    <BaseTaxonomy>http://xbrl.sec.gov/dei/2019-01-31</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>true</HasCalculationLinkbase>
</FilingSummary>
