Zap! You just touched a metal doorknob after shuffling your rubber-soled feet across the carpet. Yipes! You've been struck by lightning! Well, not really, but it's the same idea.

Your rubber-soled shoes picked up stray electrons from the carpet. Those electrons built up on your shoes giving them a static charge. (Static means not moving.) Static charges are always "looking" for the first opportunity to "escape," or discharge. Your contact with a metal doorknob—or car handle or anything that conducts electricity—presents that opportunity and the excess electrons jump at the chance.

What causes lightning?

Watch this video to learn about what causes lightning! Click here to download this video (1920x1080, 102 MB, video/mp4).

So, do thunderclouds have rubber shoes? Not exactly, but there is a lot of shuffling going on inside the cloud.

Lightning begins as static charges in a rain cloud. Winds inside the cloud are very turbulent. Water droplets in the bottom part of the cloud are caught in the updrafts and lifted to great heights where the much colder atmosphere freezes them. Meanwhile, downdrafts in the cloud push ice and hail down from the top of the cloud. Where the ice going down meets the water coming up, electrons are stripped off.

It's a little more complicated than that, but what results is a cloud with a negatively charged bottom and a positively charged top. These electrical fields become incredibly strong, with the atmosphere acting as an insulator between them in the cloud.

When the strength of the charge overpowers the insulating properties of the atmosphere, Z-Z-Z-ZAP! Lightning happens.

How does the lightning "know" where to discharge—or strike?

The electric field "looks" for a doorknob. Sort of. It looks for the closest and easiest path to release its charge. Often lightning occurs between clouds or inside a cloud.

But the lightning we usually care about most is the lightning that goes from clouds to ground—because that's us!

Animated image shows lightning branches spreading out very slowly toward the ground, then, once the ground is touched, a bright stroke travels up to the cloud and it flickers even more brightly a couple of times.

As the storm moves over the ground, the strong negative charge in the cloud attracts positive charges in the ground. These positive charges move up into the tallest objects like trees, telephone poles, and houses. A "stepped leader" of negative charge descends from the cloud seeking out a path toward the ground. Although this phase of a lightning strike is too rapid for human eyes, this slow-motion video shows it happening.

As the negative charge gets close to the ground, a positive charge, called a streamer, reaches up to meet the negative charge. The channels connect and we see the lightning stroke. We may see several strokes using the same path, giving the lightning bolt a flickering appearance, before the electrical discharge is complete.

Still image from animated drawing showing lightning descending from cloud and positively charged streamers reaching up from tall objects on the ground.

Click for larger animated image!

What causes thunder?

In a fraction of a second, lightning heats the air around it to incredible temperatures—as hot as 54,000 °F (30,000 °C). That's five times hotter than the surface of the Sun!

The heated air expands explosively, creating a shockwave as the surrounding air is rapidly compressed. The air then contracts rapidly as it cools. This creates an initial CRACK sound, followed by rumbles as the column of air continues to vibrate.

If we are watching the sky, we see the lightning before we hear the thunder. That is because light travels much faster than sound waves. We can estimate the distance of the lightning by counting how many seconds it takes until we hear the thunder. It takes approximately 5 seconds for the sound to travel 1 mile. If the thunder follows the lightning almost instantly, you know the lightning is too close for comfort!

What does lightning look like from space?

Lightning observed by the GOES-16 Geostationary Lightning Mapper (GLM) illuminates the storms developing over southeast Texas on the morning of February 14, 2017.

Lightning is an important part of weather forecasting. The Geostationary Lightning Mapper instrument on the GOES-R series satellites can detect lightning activity over nearly the whole Western Hemisphere.

Scientists use data from GOES-R series satellites, along with data from the Lightning Imaging Sensor on NASA's Tropical Rainfall Measuring Mission satellite, to study lightning. This complete picture of lightning at any given time will improve "now-casting" of dangerous thunderstorms, tornadoes, hail, and flash floods.