(NERDWALLET) — Smoking in your car is harmful to you and your passengers, but it also hurts the resale value of your car.

Smoking can reduce the car’s trade-in value by at least $500, according to Richard Arca, director of vehicle valuations and analytics for auto website Edmunds. Other sources put the cost even higher.

A study by the National Center for Biotechnology Information, or NCBI, estimates that smoking in a car reduces its resale value by 7.7%. So, for example, a car with a trade-in value of $20,000 would instead sell for $18,460, or $1,540 less.

Most online used-car buying sites — which let you sell your car online sight unseen based on a questionnaire — ask at least about “persistent odors,” if not specifically about smoking.

In evaluating the same car two different ways (smoked in and never smoked in), online used-car retailer Vroom’s appraisal tool reduced the company’s purchase offer by $1,000. Carvana’s reduction was less for the same car, cutting its offering price by only $289.

Why smoke depreciates your car’s value

When cars are evaluated for trade-in, a number of factors affect their value, such as mechanical condition and the number of miles driven. The condition of the interior is another big factor: The smell of smoke makes a vehicle harder to sell and is expensive to recondition.

Smoke “will permeate the entire vehicle interior,” says Michael Stoops, senior global product and training specialist for Meguiar’s car care products. The odor stubbornly lingers — even in “areas you can neither see nor reach, such as inside the air conditioning system.”

Besides reducing a car’s value, it can be a deal breaker if you’re trying to sell your smoked-in car and a potential buyer sniffs the telltale smoke odor, Arca says. There also might be signs of visible damage potential buyers could notice. For example, smokers sometimes drop ash on car seats, which leaves burn marks on the upholstery that would be expensive to repair.

A lot more than a persistent bad smell

Lighting a cigarette in a car is unhealthy for even nonsmoking passengers, and the threat remains long after the cigarette is extinguished. “Third-hand smoke” refers to the gases and particulates absorbed by the car’s interior and then re-emitted over time.

This second- and third-hand smoke can be hazardous for the car’s new owner, but it’s especially hazardous for young people.

“Several studies show that kids, cars and cigarettes are a particularly dangerous combination,” according to the American Nonsmokers’ Rights Foundation.

In fact, smoking in a car with a young person is illegal in nine states and Puerto Rico: It’s outlawed for anyone driving with a passenger under a certain age.

The warning from the NCBI is even more dire: “Secondhand smoke (SHS) causes premature death and disease in children and adults, and the scientific evidence indicates that there is no risk-free level of exposure to SHS.”

Can you get rid of the smoking smell in your car?

If you buy a used car and later detect a smoke smell, or you are selling a car that you’ve smoked in and don’t want to take a hit on the resale value, all is not lost.

It is possible to eliminate smoking smells almost entirely “in all but the worst cases, but it takes a concerted effort,” says Mark Holthoff, Carvana’s senior editor of content. But he says that off-the-shelf solutions and home remedies, such as leaving coffee grounds in the car, often just mask the smell temporarily.

Stoops says ridding a car of a smoke smell requires a thorough cleaning of all surfaces inside the vehicle, especially soft surfaces that “tend to hold smoke odor more tenaciously than hard surfaces.”

Products to treat or eliminate smoke smell abound. For example, Meguiar’s Air Re-Fresher canister dispenses while the engine is running and the air conditioning is on high and recirculating mode. It and similar products sell for about $10 for a single canister.

Is ozone the magic smoke-eraser?

Cleaning services have had success using ozone generators to extract the cigarette smell. Mike Lightman, owner of Odor Removal Experts of OC, says the treatment costs $169 for a midsized sedan. The car is left running during the process so the ventilation system can circulate.

“I never say it removes the smell completely because people remember smells and then expect them,” says Lightman. “But it will remove the smell to the point that you’ll be satisfied.”

Once the treatment is complete, Stoops recommends airing out the car to remove all traces of ozone because it can cause eye, nose, throat and lung irritation.

Ozone generators are available for home use, running from $70 to more than $3,000.

DIY smoke removal

A thorough professional auto detail may be able to remove most smoke smells, but if you want to try to remove cigarette smell yourself, here are the key issues to address, says Stoops:

  • Remove all items and debris from the car, including the glove box.
  • Shampoo the upholstery with a car care product designed for that purpose.
  • Vacuum, wash and shampoo the floor mats thoroughly.
  • Use all-purpose cleaners and vinyl cleaners for all other surfaces, such as the dashboard and door panels.
  • Use a vinegar and water solution to remove nicotine film from windows.
  • Steam clean the headliner — the ceiling material — or replace it if the smell persists.
  • Replace the cabin air filters.

(Information from NerdWallet.com via the Nexstar Media Wire)