Complex networks have been studied extensively owing to their relevance to many real systems such as the world-wide web, the Internet, energy landscapes and biological and social networks. A large number of real networks are referred to as `scale-free' because they show a power-law distribution of the number of links per node. However, it is widely believed that complex networks are not invariant or self-similar under a length-scale transformation. This conclusion originates from the `small-world' property of these networks, which implies that the number of nodes increases exponentially with the `diameter' of the network, rather than the power-law relation expected for a self-similar structure. Here we analyse a variety of real complex networks and find that, on the contrary, they consist of self-repeating patterns on all length scales. This result is achieved by the application of a renormalization procedure that coarse-grains the system into boxes containing nodes within a given `size'. We identify a power-law relation between the number of boxes needed to cover the network and the size of the box, defining a finite self-similar exponent. These fundamental properties help to explain the scale-free nature of complex networks and suggest a common self-organization dynamics.