content: <?xml version="1.0" encoding="UTF-8"?><edgarSubmission xmlns="http://www.sec.gov/edgar/ownership" xmlns:com="http://www.sec.gov/edgar/common">
    <headerData>
      <submissionType>144</submissionType>
      <filerInfo>
        <filer>
          <filerCredentials>
            <cik>0001519321</cik>
            <ccc>XXXXXXXX</ccc>
          </filerCredentials>
        </filer>
        <liveTestFlag>LIVE</liveTestFlag>
  
  
      </filerInfo>
    </headerData>
    <formData>
      <issuerInfo>
        <issuerCik>0000866273</issuerCik>
        <issuerName>MATRIX SERVICE CO</issuerName>
        <secFileNumber>001-15461</secFileNumber>
        <issuerAddress>
          <com:street1>15 EAST 5TH STREET</com:street1>
          <com:street2>SUITE 1100</com:street2>
          <com:city>TULSA</com:city>
          <com:stateOrCountry>OK</com:stateOrCountry>
          <com:zipCode>74103</com:zipCode>
        </issuerAddress>
        <issuerContactPhone>9188388822</issuerContactPhone>
        <nameOfPersonForWhoseAccountTheSecuritiesAreToBeSold>HEWITT JOHN R</nameOfPersonForWhoseAccountTheSecuritiesAreToBeSold>
        <relationshipsToIssuer>
          <relationshipToIssuer>Officer</relationshipToIssuer>
          <relationshipToIssuer>Director</relationshipToIssuer>
        </relationshipsToIssuer>
      </issuerInfo>
      <securitiesInformation>
        <securitiesClassTitle>COMMON</securitiesClassTitle>
        <brokerOrMarketmakerDetails>
          <name>BOK Financial-Pershing LLC</name>
          <address>
            <com:street1>One Williams Center</com:street1>
            <com:street2>Plaza NE</com:street2>
            <com:city>Tulsa</com:city>
            <com:stateOrCountry>OK</com:stateOrCountry>
            <com:zipCode>74172</com:zipCode>
          </address>
        </brokerOrMarketmakerDetails>
        <noOfUnitsSold>10000</noOfUnitsSold>
        <aggregateMarketValue>129900.00</aggregateMarketValue>
        <noOfUnitsOutstanding>27304734</noOfUnitsOutstanding>
        <approxSaleDate>03/20/2024</approxSaleDate>
        <securitiesExchangeName>NASDAQ</securitiesExchangeName>
      </securitiesInformation>
      <securitiesToBeSold>
        <securitiesClassTitle>COMMON</securitiesClassTitle>
        <acquiredDate>08/26/2018</acquiredDate>
        <natureOfAcquisitionTransaction>STOCK AWARD</natureOfAcquisitionTransaction>
        <nameOfPersonfromWhomAcquired>ISSUER</nameOfPersonfromWhomAcquired>
        <isGiftTransaction>N</isGiftTransaction>
        <amountOfSecuritiesAcquired>2094</amountOfSecuritiesAcquired>
        <paymentDate>08/26/2018</paymentDate>
        <natureOfPayment>COMPENSATION</natureOfPayment>
      </securitiesToBeSold>
      <securitiesToBeSold>
        <securitiesClassTitle>COMMON</securitiesClassTitle>
        <acquiredDate>08/29/2019</acquiredDate>
        <natureOfAcquisitionTransaction>STOCK AWARD</natureOfAcquisitionTransaction>
        <nameOfPersonfromWhomAcquired>ISSUER</nameOfPersonfromWhomAcquired>
        <isGiftTransaction>N</isGiftTransaction>
        <amountOfSecuritiesAcquired>7906</amountOfSecuritiesAcquired>
        <paymentDate>08/29/2019</paymentDate>
        <natureOfPayment>COMPENSATION</natureOfPayment>
      </securitiesToBeSold>
      <nothingToReportFlagOnSecuritiesSoldInPast3Months>Y</nothingToReportFlagOnSecuritiesSoldInPast3Months>
      <noticeSignature>
        <noticeDate>03/20/2024</noticeDate>
        <signature>/s/ John R. Hewitt</signature>
      </noticeSignature>
    </formData>
  </edgarSubmission>
metadata_documents: [{"type": "144", "sequence": "1", "filename": "primary_doc.xml", "secsgml_size_bytes": 3370}]
text: 144
  0001519321
  XXXXXXXX
  LIVE
  0000866273
  MATRIX SERVICE CO
  001-15461
  15 EAST 5TH STREET
  SUITE 1100
  TULSA
  OK
  74103
  9188388822
  HEWITT JOHN R
  Officer
  Director
  COMMON
  BOK Financial-Pershing LLC
  One Williams Center
  Plaza NE
  Tulsa
  OK
  74172
  10000
  129900.00
  27304734
  03/20/2024
  NASDAQ
  COMMON
  08/26/2018
  STOCK AWARD
  ISSUER
  N
  2094
  08/26/2018
  COMPENSATION
  COMMON
  08/29/2019
  STOCK AWARD
  ISSUER
  N
  7906
  08/29/2019
  COMPENSATION
  Y
  03/20/2024
  /s/ John R. Hewitt