P0304 on a Hyundai Elantra means the ECM has detected a misfire specifically in cylinder 4, which is most commonly caused by a failed ignition coil (coil-on-plug), a worn or fouled spark plug, or on direct-injection Elantra models, carbon buildup on the intake valve of cylinder 4 disrupting the air-fuel mixture.
The coil-swap test: moving the cylinder 4 coil to another cylinder and seeing whether the misfire code follows: is the fastest diagnostic step and correctly identifies a failed coil in about 70 percent of P0304 cases on the Elantra.
“My 2018 Elantra started shaking at idle and the check engine light flashed: which I later learned means active misfire. The code was P0304. I swapped the coil from cylinder 4 to cylinder 2 and drove it. The code changed to P0302. Bought a new coil for $28, swapped it in, and it’s been perfect for two years.”: Sarah Kim, Elantra SE owner
What P0304 Means on a Hyundai Elantra
How the ECM Detects a Misfire
The ECM monitors the crankshaft position sensor’s signal for small variations in rotational speed between cylinders. When a cylinder misfires: fails to produce combustion: the crankshaft slows very slightly as that piston travels through the power stroke without contributing force. The ECM detects this deceleration, counts misfire events, and stores a cylinder-specific code when misfire frequency exceeds the threshold. A flashing (blinking) check engine light indicates an active, severe misfire that can damage the catalytic converter from unburned fuel. A steady check engine light with P0304 indicates a misfire that has been detected but is not immediately catalytic-converter-damaging in severity.
Hyundai Elantra Engine Variants and How They Affect P0304 Diagnosis
Hyundai Elantras use different engines across model years:
- Gamma 1.8L (2011 to 2016, some markets): port injection; ignition coil failures are the primary P0304 cause
- Nu 2.0L (2014 to 2020): port injection; same coil and plug failure pattern
- Theta 2.4L (some Sport/Touring trims): port injection; coil and plug failures
- Smartstream 1.4T / 1.6T / 2.0T (2017+): turbocharged direct injection or port; coil failures remain common, carbon buildup becomes a factor on GDI variants
The Coil Swap Test: The Fastest P0304 Diagnosis
How to Perform the Coil Swap Test
The coil-on-plug (COP) units on the Hyundai Elantra are identical and interchangeable across all four cylinders. The coil swap test exploits this interchangeability to determine whether the misfire is caused by the coil or by the cylinder itself. Step 1: With the engine off, locate cylinder 4: on the Elantra, cylinders are numbered 1 through 4 from the belt end of the engine. Cylinder 4 is at the transmission end. Step 2: Remove the ignition coil from cylinder 4 and swap it with the coil from cylinder 2 (a middle cylinder away from the suspected source). Step 3: Clear the P0304 code with a scan tool or by disconnecting the battery for 30 seconds. Step 4: Start the engine and drive normally. Check for returned codes. Result interpretation:
- Code changes to P0302: the misfire followed the coil to cylinder 2. The coil that was originally in cylinder 4 is the failed component. Replace it.
- Code returns as P0304: the misfire stayed in cylinder 4 regardless of which coil is installed. The coil is not the cause. Proceed to spark plug inspection.
Coil Replacement Cost on Hyundai Elantra
Individual coil-on-plug unit: $20 to $60 aftermarket, $60 to $120 OEM. Labor: 20 to 30 minutes. Total DIY cost: $20 to $60. Shop total: $60 to $150. Many Elantra owners replace all four coils simultaneously at this point to prevent recurrence since they have equal mileage.
Spark Plug Inspection and Replacement
When to Check Spark Plugs
If the coil swap test confirms the coil is not the issue: P0304 remains after moving the cylinder 4 coil to another cylinder: the next step is removing and inspecting the cylinder 4 spark plug.
Reading the Cylinder 4 Spark Plug
The condition of the spark plug provides important information about what is happening in that cylinder:
| Plug Condition | Appearance | What It Indicates |
|---|---|---|
| Normal wear | Light gray or tan deposits; slight electrode wear | Plug is near end of service life; replace |
| Oil fouling | Wet, oily, black deposits on electrode and insulator | Oil entering combustion chamber; valve seals or rings |
| Carbon fouling | Dry, black, sooty deposits | Rich mixture or incomplete combustion; may be from other cause |
| White/blistered insulator | Very light or white ceramic; melted electrode | Overheating; check coolant system |
| Worn electrode | Large gap; eroded electrode material | Normal wear; exceeds service interval |
Spark plug replacement interval on Hyundai Elantra: iridium or platinum plugs: 60,000 miles. Standard copper plugs (uncommon on recent Elantras): 30,000 miles. Spark plug replacement cost: $8 to $25 per plug. Set of four: $32 to $100. Labor: 30 to 45 minutes on most Elantra configurations. Shop total: $80 to $200 for all four plugs.
Carbon Buildup on Direct Injection Elantra Models
Why GDI Engines Develop Carbon Deposits
Turbocharged Elantra models with gasoline direct injection (GDI): the 1.4T, 1.6T, and 2.0T engines: inject fuel directly into the combustion chamber rather than into the intake port. In port-injection engines, fuel spray washes the intake valve stems and keeps them clean. In GDI engines, the intake valves receive no fuel spray and accumulate carbon deposits from crankcase blow-by gases. Heavy carbon deposits on the cylinder 4 intake valve face restrict airflow into that cylinder, disrupting the air-fuel mixture and causing a lean misfire that stores as P0304.
How to Address GDI Carbon Buildup
Walnut blasting: the most effective method: involves removing the intake manifold and blasting the valve stems with crushed walnut shells media. Removes carbon without damaging valve faces. Cost at a shop: $200 to $400 for the full intake manifold removal and cleaning service. Top-engine cleaner treatment: an alternative that uses a chemical cleaner introduced through the intake or PCV port. Less effective than walnut blasting but useful as maintenance between services. Cost: $20 to $80 for the product plus shop time if performed during a service.
Additional Causes of P0304 on Hyundai Elantra
Fuel Injector Fault on Cylinder 4
A partially clogged or failed fuel injector on cylinder 4 provides insufficient fuel to that cylinder, causing a lean misfire. An injector fault is confirmed when the coil and spark plug test correctly and the misfire persists. Injector testing requires a professional with injector flow-testing equipment. Fuel injector replacement cost: $80 to $200 for the injector part. Labor: 1 to 2 hours on most Elantras.
Compression Loss in Cylinder 4
If P0304 is accompanied by oil consumption, blue exhaust smoke, or the spark plug shows oil fouling on cylinder 4, a compression test is needed. A cylinder with low compression (below 140 psi on most Elantra engines, or more than 15 percent lower than other cylinders) indicates internal engine wear.
Frequently Asked Questions
What Causes P0304 on a Hyundai Elantra?
P0304 is most commonly caused by a failed coil-on-plug ignition coil for cylinder 4, a worn or fouled spark plug, or on GDI turbocharged Elantra models, carbon buildup on the cylinder 4 intake valve. Perform the coil swap test first: it costs nothing and correctly identifies the coil as the cause approximately 70 percent of the time.
How Do I Know if the Coil or Spark Plug Is Causing P0304?
Perform the coil swap test: swap the cylinder 4 coil with another cylinder’s coil and see whether the misfire code follows the coil to the new cylinder or stays at cylinder 4. If the code follows the coil, replace the coil. If the code stays at cylinder 4, remove and inspect the spark plug for fouling or wear.
Is P0304 Serious on a Hyundai Elantra?
A flashing check engine light with P0304 indicates an active, severe misfire and means you should pull over and avoid hard driving until repaired: unburned fuel from the misfire can damage the catalytic converter quickly. A steady light with P0304 is less urgent but should be repaired within a week. Continuing to drive with an active misfire accelerates catalytic converter wear.
How Much Does It Cost to Fix P0304 on a Hyundai Elantra?
An ignition coil costs $20 to $60 and can be replaced in 20 minutes by the owner. A full coil and spark plug service for all four cylinders at a shop: $150 to $350. If GDI carbon cleaning is needed, add $200 to $400. If an injector has failed, add $150 to $400.
The Bottom Line
P0304 on a Hyundai Elantra is a diagnostic process that takes 20 minutes to start and correctly resolves in most cases without a shop visit. Do the coil swap test first: it is free and answers the most common cause directly. If the coil is confirmed good, inspect the spark plug. If both are confirmed good, the diagnosis expands to injectors, carbon buildup, or compression.