This paper investigates the problem of nonfragile H∞ and H2 filter designs for continuous-time linear systems. Additive filter gain variations to reflect the imprecision in filter implementation are considered. The nonfragile filter design is first formulated as a robust convex optimization problem. Then, both deterministic and randomized algorithms are employed to solve the obtained robust convex optimization problem. Compared with the deterministic algorithm, the proposed randomized one has two advantages: On one hand, it has acceptable computational complexity for systems with high dimensions; on the other hand, it can alleviate the conservatism of deterministic algorithms. Several examples are given to illustrate the effectiveness of the proposed method.