Objective. In this paper, a new algorithm is proposed to compute the spontaneously generated respiratory effort during ventilation. Methods: The algorithm computes a ventilated patient's respiratory effort in real-time by analyzing the respiratory pressure and flow signals that are acquired from the ventilator. The method requires an initial period where the patient's respiratory muscles are fully relaxed, for example during or shortly after surgery. During this period the patient's inspiratory airway resistance R in, the expiratory airway resistance R ex, the lung-thorax compliance C lt and the residual pressure after an infinitely long expiration P 0 are estimated by fitting the measured flow onto the measured pressure at the mouth using a model of the patient's respiratory system. When the patient starts breathing, the relation between the measured pressure and the flow changes, from which the respiratory effort of the patient P mus can be computed. Results: The pressure P mus can be computed in real-time by using an equivalent model of the respiratory system of the patient. The estimation can be done with a recursive least squares (RLS) method. Further, the resulting P mus signal appears to have a constant shape, in which the main changing factor is the maximum amplitude per breath. Conclusion: The respiratory effort increases over time until the patient is disconnected from the ventilator. We hope the maximum amplitude can be used as an indicator of the pressure the muscles of the patient are able to produce. This amplitude of the P mus-signal in combination with the standard deviation (SD) may eventually lead to a new indicator to determine the moment that the patient can be weaned from the ventilator. This will have to be examined in the future.