Exhibit 23.1

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

As independent registered public accountants, we consent to the incorporation by reference in the Registration Statements of Sun Hydraulics Corporation on Forms S-8 (File No. 333-30801, effective July 3, 1997, File No. 333-83269, effective July 20, 1999, File No. 333-62816, effective June 12, 2001, File No. 333-66008 effective July 27, 2001, File No. 333-119367, effective September 29, 2004, File No. 333-124174, effective April 19, 2005, File No. 333-158245, effective March 27, 2009, File No. 333-177448 effective October 21, 2011 and File No. 333-184840, effective November 9, 2012) of our report dated June 13, 2013, relating to the statements of net assets available for benefits of Sun Hydraulics Corporation 401(k) and ESOP Retirement Plan as of December 31, 2012 and 2011, the related statements of changes in net assets available for benefits for the years then ended, and the related supplemental schedules as of December 31, 2012, which report appears in the December 31, 2012 annual report on Form 11-K of Sun Hydraulics Corporation 401(k) and ESOP Retirement Plan.

/s/ Mayer Hoffman McCann P.C.

June 13, 2013

Clearwater, Florida