I have read The Prince, Discourses on Livy and The Art of War. In none of these books did I find the quote oft-attributed to Machiavelli that “the ends justify the means”. Did he say it? If so, where? Or is it a misquote? If he didn’t say it, where did it originate?
It is incorrectly assigned to Machiavelli, when it should be to Ovid.
Exitus acta probat
is the original, in latin form for
The ends justify the means
Written by Publius Ovidius Naso a.k.a Ovid in the collection Heroides (The Heroines), Ovid's most influential work.
Full transcription and quotation can be found here Heroides, II, 85.
There is none saying "verbatim" that.
We have in N.Machiavelli, Il Principe, cap. XVIII (see Il Principe ) :
"... e nelle azioni di tutti li uomini, e massime de’ principi, dove non è iudizio da reclamare, si guarda al fine. Facci dunque uno principe di vincere e mantenere lo stato: e mezzi saranno sempre iudicati onorevoli e da ciascuno lodati".
From Niccolò Machiavelli, The Prince, The Harvard Classics, 1909-14 :
Moreover, in the actions of all men, and most of all of Princes, where there is no tribunal to which we can appeal, we look to results. Wherefore if a Prince succeeds in establishing and maintaining his authority, the means will always be judged honourable and be approved by every one.
Note : see also this post for comments and interpretation.