Car Stalls While Driving or at Stops -- Codes and Causes

symptoms 5 min read Updated 2026-04-15

Why Stalling Is a Safety Issue

A car that stalls isn't just inconvenient. It's dangerous. When your engine stalls, you lose power steering, making the wheel very hard to turn. You also lose power brake assist after one or two pumps of the pedal. If you stall in traffic, on a highway, or in an intersection, you're in a risky situation. Unlike a rough idle or a check engine light, stalling is a problem you should address immediately. Don't plan to fix it next week. Get it diagnosed today. The causes are usually not expensive to repair, but the consequences of stalling at the wrong moment can be severe.

Idle Control Failures: P0505 and P0507

The idle air control system keeps your engine running when you take your foot off the gas. When this system fails, the engine can't maintain idle speed and stalls. Code P0505 means the idle air control system is malfunctioning, and code P0507 indicates the idle RPM is higher than expected, which often precedes a stalling condition as the system overcompensates. A dirty throttle body is the most common cause and takes 15 minutes to clean. Remove the air intake hose, spray throttle body cleaner on the throttle plate, wipe away the carbon buildup, and reassemble. If cleaning doesn't solve it, the idle air control valve or throttle body may need replacement, typically $100 to $300.

Sensor Failures That Cause Stalling

Two sensors can cause immediate stalling when they fail. The crankshaft position sensor (code P0335) tells the computer where the engine is in its rotation. If this sensor drops out intermittently, the computer loses track of engine timing and the engine dies instantly, without sputtering or warning. The camshaft position sensor (code P0340) works similarly. If your car stalls suddenly with no warning, especially when warm, a failing crank or cam sensor is a strong suspect. These sensors often fail when they get hot and work again once they cool down, which is why the stalling can be intermittent and hard to reproduce at a repair shop.

Fuel and Air Delivery Problems

A lean fuel condition, indicated by code P0171, means the engine isn't getting enough fuel relative to air. When the lean condition is severe enough, the engine stalls, especially at idle or deceleration when fuel demand changes. Vacuum leaks are the most common cause of lean stalling. Look for cracked, brittle, or disconnected rubber hoses around the engine. A failing fuel pump can also cause stalling. If the car stalls at highway speed and takes a few minutes before it will restart, the fuel pump may be overheating and shutting down. Listen for the fuel pump hum when you turn the key to the on position without cranking.

What to Do When Your Car Stalls

If you stall while driving, stay calm. Turn on your hazard lights immediately. Try to steer to the shoulder or out of traffic. Shift to neutral and try to restart the engine. Many stalling conditions allow a restart after a few seconds. Once you're safely stopped, try starting the car again. If it starts and runs, drive directly to a repair shop or auto parts store to get the codes scanned. If it won't restart, call for a tow. When you get the codes read, look for P0505, P0507, P0335, P0340, or P0171. Look up your specific code on Car Code Finder to understand the repair before you talk to a mechanic.

Frequently Asked Questions

Why does my car stall at stop signs but runs fine otherwise?

Stalling only at stops usually points to an idle control problem. Your engine needs a specific system to keep running at low RPM when your foot is off the gas. A dirty throttle body, failing idle air control valve (code P0505), or vacuum leak (code P0171) are the most common causes. Try cleaning the throttle body first, as it's a free fix using about $8 worth of cleaner.

Can a bad battery cause a car to stall?

A bad battery itself won't cause stalling, but a failing alternator will. If the alternator isn't charging properly, the battery voltage drops while driving, and eventually the engine computer and fuel injection system don't have enough power to operate. You'll usually see the battery light on the dashboard before it gets to the stalling point. Have the alternator and battery tested at an auto parts store for free.

My car stalls when I turn on the AC. What's wrong?

The AC compressor puts a significant load on the engine. A healthy idle control system compensates by raising the idle speed when AC kicks in. If the idle control system is marginal, code P0505 or P0507 may be present, and the extra AC load pushes the engine below the RPM needed to stay running. Cleaning the throttle body and checking for vacuum leaks are the first steps to fix this.