1
                                                                     EXHIBIT 5.1


                          [LATHAM & WATKINS LETTERHEAD]


                               September 27, 2001






IDEX Corporation
630 Dundee Road, Suite 400
Northbrook, Illinois 60062

          Re:  Registration Statement on Form S-8 with respect to
               900,000 shares of Common Stock, par value $.01 per share

Ladies and Gentlemen:

          In connection with the preparation and filing by IDEX Corporation, a
Delaware corporation (the "Company") with the Securities and Exchange Commission
(the "Commission") under the Securities Act of 1933, as amended (the "Act"), of
a Registration Statement on Form S-8 (the "Registration Statement") relating to
the issuance by the Company of 900,000 shares of the Company's Common Stock, par
value $.01 per share (the "Shares"), pursuant to the 2001 Stock Plan for
Officers of IDEX Corporation (the "Officers Stock Plan"), and $2,616,000 in
deferred compensation obligations (the "Obligations") under the IDEX Corporation
1996 Deferred Compensation Plan for Officers (the "Officers Deferred
Compensation Plan"), you have requested our opinion with respect to the matters
set forth below.

          In our capacity as your counsel in connection with such registration,
we are familiar with the proceedings taken by the Company in connection with the
authorization, issuance and sale of the Shares and the authorization of the
Obligations. In addition, we have made such legal and factual examinations and
inquiries, including an examination of originals or copies certified or
otherwise identified to our satisfaction of such documents, corporate records
and instruments, as we have deemed necessary or appropriate for purposes of this
opinion.

          In our examination, we have assumed the genuineness of all signatures,
the authenticity of all documents submitted to us as originals and the
conformity to authentic original documents of all documents submitted to us as
copies.

          We are opining herein as to the effect on the subject transaction only
of the General Corporation Law of the State of Delaware, and we express no
opinion with respect to the


   2

LATHAM & WATKINS

September 27, 2001
Page 2


applicability thereto, or the effect thereon, of the laws of any other
jurisdiction or any other Delaware laws, or as to any matters of municipal law
or the laws of any local agency within any state.

          Subject to the foregoing, it is our opinion that the Shares have been
duly authorized and, when issued and sold upon exercise of the options for such
Shares and payment of the exercise price therefor as contemplated by the
Officers Plan, will be validly issued, fully paid and nonassessable and that the
Obligations, when arising under the Officers Deferred Compensation Plan in
accordance with its terms, will be duly authorized, legally valid and binding
obligations of the Company, except as may be limited by the effect of
bankruptcy, insolvency, reorganization, moratorium or other similar laws now or
hereafter in effect relating to or affecting the rights or remedies of
creditors; and the effect of general principles of equity, including without
limitation, concepts of materiality, reasonableness, good faith and fair dealing
and the possible unavailability of specific performance or injunctive relief
regardless of whether considered in a proceeding in equity or at law.

          We consent to your filing this opinion as an exhibit to the
Registration Statement.

                                              Very truly yours,

                                              /s/ Latham & Watkins

                                              Latham & Watkins







                                        2