Exhibit 23.1

CONSENT OF INDEPENDENT REGISTERED PUBLIC ACCOUNTING FIRM

We hereby consent to the incorporation by reference in the Registration Statements on Form S-8 (Nos. 333-168950, 333-177853, 333-186501, 333-221423 and 333-222154) of Fabrinet of our report dated August 22, 2018 relating to the financial statements and the effectiveness of internal control over financial reporting, which appears in this Form 10-K.

/s/ PricewaterhouseCoopers ABAS Ltd.

PricewaterhouseCoopers ABAS Ltd.

Bangkok, Thailand

August 22, 2018