The intensity of an earthquake is a measure of the shaking created by the earthquake. Intensity varies with location.
The magnitude of an earthquake is a measured value of the energy released by an earthquake calculated from the amount of slip on a fault multiplied by the size of the area that slipped. The magnitude of an earthquake is the same no matter where you are, or how strong or weak the shaking was in various locations.