The two are completely different. While both of them try to create music with a somewhat bombastic, occasionally mystical feel, Williams' music is quite straightforward, very melodic, certainly more memorable, and altogether conventional. There's not much of a difference between the Star Wars, Indiana Jones, and Harry Potter themes and romantic music. Star Wars' and Indiana Jones' soundtracks in particular ape the sound film serials from the 1930s and '40s, with their heroic feel, use of major scales, and powerful melodies.
Hans Zimmer writes music that synthesizes the conventional "Hollywood strings" style of music with rock, electronics, and other popular modern genres. His scores are almost always very rhythm-heavy and harmonious, but much more forgettable. Hans Zimmer isn't a poor composer, he's amazing, but Williams' music is (usually) more memorable, mainly due to its format. While I'm not sure if Zimmer is less talented than his more famous rival, the two are really, really different.
Personally, I think that Howard Shore (he composed for Lord of the Rings, The Aviator, and Hugo) is way more similar to John Williams than Hans Zimmer is. Shore and Zimmer both have that aforementioned emphasis on stirring themes, which makes their music really powerful and memorable.