1
                                  EXHIBIT 5.01

                                December 27, 1996




HNC Software Inc.
5930 Cornerstone Court West
San Diego, California 92121-3728

Ladies & Gentlemen:

         At your request, we have examined the Registration Statement on Form
S-8 (the "Registration Statement") to be filed by you with the Securities and
Exchange Commission on or about December 27, 1996 in connection with the
registration under the Securities Act of 1933, as amended, of (i) an aggregate
of 1,750,000 additional shares of the Common Stock (the "Common Stock") of HNC
Software Inc. ("HNC") subject to issuance by HNC pursuant to the HNC Software
Inc. 1995 Equity Incentive Plan, as amended through December 6, 1996 (the
"Plan"), and (ii) 155,864 shares of the Common Stock which are issuable upon the
exercise of options originally granted by Retek Distribution Corporation
("Retek") that have been assumed by HNC and converted into options to purchase
Common Stock (the "Assumed Options") pursuant to the Exchange Agreement dated as
of October 25, 1996 (the "Exchange Agreement") between HNC Software Inc. ("HNC")
and the shareholders of Retek and the Option Exchange Agreements entered into in
connection therewith between HNC and the holders of outstanding options to
purchase shares of Retek (the "Option Exchange Agreements").

         In rendering this opinion, we have examined the following:

         (1)      the Registration Statement, together with the Exhibits filed
                  as a part thereof, including, without limitation the Plan, the
                  Assumed Options and related documents;

         (2)      the Prospectus prepared in connection with the Plan and with
                  the Registration Statement;

         (3)      the Prospectus prepared in connection with the Assumed Options
                  and with the Registration Statement;

         (4)      the minutes of meetings and actions by written consent of the
                  stockholders and Board of Directors of HNC relating to the
                  Plan that you have provided to us;

         (5)      the minutes of meetings and actions by written consent of the
                  stockholders and Board of Directors of HNC relating to the
                  Exchange Agreement, the Option Exchange Agreements and the
                  assumption by HNC of the Assumed Options, the Exchange
                  Agreement and the Option Exchange Agreements; and

         (6)      the Certificate of Incorporation of HNC, as amended and
                  restated through June 13, 1996 and the Bylaws of HNC, both as
                  filed by HNC with its Report on Form 10-Q for the quarter
                  ended June 30, 1996.



   2
         In our examination of documents for purposes of this opinion, we have
assumed, and express no opinion as to, the genuineness of all signatures on
original documents, the authenticity of all documents submitted to us as
originals, the conformity to originals of all documents submitted to us as
copies, the lack of any undisclosed terminations, modifications, waivers or
amendments to any documents reviewed by us and the due execution and delivery of
all documents where due execution and delivery are prerequisites to the
effectiveness thereof.

         As to matters of fact relevant to this opinion, we have relied solely
upon our examination of the documents referred to above and have assumed the
current accuracy and completeness of the information and records included in the
documents referred to above. We have made no independent investigations or other
attempts to verify the accuracy of any of such information or to determine the
existence or non-existence of any other factual matters; however, we are not
aware of any facts that would lead us to believe that the opinion expressed
herein is not accurate. Our opinion below is given on the assumption that
shares of Common Stock may not be issued and sold by HNC in accordance with the
Plan unless and until such shares, at the time in question, are (i) explicitly
reserved and available for issuance under the Plan or (ii) become issuable
under the Plan in the future by virtue of the terms of Section 2.1 of the Plan,
which provide that certain shares issuable upon exercise of options granted
under the Prior Plan (as that term is defined in the Plan) that expire or
become unexercisable without having been exercised are available for grant and
issuance under the Plan.

         Based upon the foregoing, it is our opinion that:

         1. The 1,750,000 additional shares of Common Stock that may be issued
and sold by you pursuant to the Plan, when issued and sold in accordance with
the Plan and in the manner referred to in the Prospectus associated with the
Plan and the Registration Statement, and, in the case of shares of Common Stock
issuable upon exercise of stock options, the stock options issued thereunder,
will be legally issued, fully paid and nonassessable.

         2. The 155,864 shares of Common Stock that may be issued and sold by
you pursuant to exercise of the Assumed Options, when issued and sold in the
manner referred to in the Prospectus associated with the Registration Statement
and in accordance with Retek's Nonqualified Stock Option Agreements pursuant to
which the Assumed Options were granted, will be legally issued, fully paid and
nonassessable.

         We consent to the use of this opinion as an exhibit to the Registration
Statement and further consent to all references to us, if any, in the
Registration Statement, the Prospectus constituting a part thereof and any
amendments thereto.

         This opinion speaks only as of its date and is intended solely for the
your use as an exhibit to the Registration Statement for the purpose of the
above sale of the Common Stock and is not to be relied upon for any other
purpose.

                                       Very truly yours,


                                       FENWICK & WEST LLP


                                       By:_______________________________