Abstract We study different representations of a given rational transfer function that represents a passive (or positive real) discrete-time system. When the system is subject to perturbations, passivity or stability may be lost. To make the system robust, we use the freedom in the representation to characterize and construct optimally robust representations in the sense that the distance to non-passivity is maximized with respect to an appropriate matrix norm. We link this construction to the solution set of certain linear matrix inequalities defining passivity of the transfer function. We present an algorithm to compute a nearly optimal representation using an eigenvalue optimization technique. We also briefly consider the problem of finding the nearest passive system to a given non-passive one.