Your first thought, when you see the flashing lights of a cop car in the rearview mirror, is "Uh-oh."

Your second thought: "How much is my insurance going to go up for this?"

Some speeding tickets may not raise your rate much or at all, depending on where you live and what other flaws are on your driving record. Others can dramatically affect your car insurance rates for years.

To affect your car insurance, a ticket of any kind – speeding, DUI, reckless driving -- must be considered a moving violation and must appear on your driving record.

Will a ticket raise my insurance?

Some traffic violations do result in an insurance increase, but many don’t. Every company makes its own rules about which violations bring about a surcharge and how big that surcharge is, unless the state has very specific rules for insurers to follow.

Reckless driving (this may include major speeding violations in some states)

Failure to stop after an accident

Fleeing from police

Racing

Driving on a suspended license

If you have a clean record, the minor violations below might not bring a rate increase. If you already have a minor violation on your record, though, it’s much more likely the second one will bring a rate increase.

If you were involved in an accident at the same time you received the ticket, you are likely to get a surcharge for the accident or the ticket, but not both.

Some violations, such as no proof of insurance or not carrying your driver’s license, are typically correctable if you show proof to the court, which then dismisses them. If you don’t provide evidence, the violation would go on your record.

Many violations are not typically considered rating factors and thus are unlikely to affect your premiums, such as:

Seat-belt tickets

Texting and cellphone violations (in states where they are not a moving violation)

Equipment violations such as broken lights

Failure to display license plates

Noise violations

Parking violations

Registration violations

Failure-to-appear violations

How much will my insurance rates increase after a ticket?

Everything depends on your insurance company and what state you live in.

Based on Insurance.com's analysis of more than 490,000 auto insurance quotes and data gathered by Quadrant Information Services, here's how much common infractions will affect your rates, on average:

Reckless driving: 22 percent

DUI first offense: 19 percent

Driving without a license or permit: 18 percent

Careless driving: 16 percent

Speeding 30 mph over the limit: 15 percent

Failure to stop: 15 percent

Improper turn: 14 percent

Improper passing: 14 percent

Following too close/tailgating: 13 percent

Speeding 15 to 29 mph over limit: 12 percent

Speeding 1 to 14 mph over limit: 11 percent

Failure to yield: 9 percent

No car insurance: 6 percent

Seat belt infractions: 3 percent

For more tailored results, use the traffic ticket calculator to enter your own age, type of dwelling, state, marital status, and length of time you’ve been with your car insurance carrier.

No two companies will raise your rates the same amount. Some won’t raise your rates after a single minor violation. Others will.

Here’s an example of just how different rate increases can be from company to company: For a driver in Apple Valley, Minnesota, with two speeding tickets 11 mph over the limit, one carrier wouldn't return a rate at all; five others increased rates anywhere from 13 to 121 percent.

How many points is a speeding ticket?

Your state may assign demerit points for some violations and suspend your license or fine you when that total reaches a certain level. Point systems vary widely by state, but too many points can bring an SR-22 requirement that automatically makes you a high-risk driver who'll need high-risk auto insurance.

But any points your state assigns after a ticket are different from the ones your insurance company uses to calculate your rates. Insurance companies make their own calculations based on your record, but each makes its own judgments about which violations to count. Each makes its own decisions about accident fault, too.

In order for an insurance company to raise your rates, your ticket must appear on your state motor vehicle record, or MVR. An MVR shows your license status, traffic violations and accident reports.

Your rates won’t increase until the insurer checks your MVR. Some may check your MVR at every renewal; some may check only every year or two, especially for longtime customers with clean records.

How long will a ticket affect my rates?

The look-back period differs by state and by company.

You should expect at minimum to be rated on violations, accidents and suspensions for the last three years. Some companies go back to the date of the incident, and others go back to the day of conviction.

Many companies will look back five or even 10 years for major violations such as a DUI. For instance, in California insurers aren’t allowed to offer a good driver discount until 10 years have passed after a DUI violation.

And, just as a violation doesn’t raise your rates until your insurer sees the offense on your MVR, the surcharge won’t stop immediately when a violation falls off your record. You will have to wait until the next policy period when your insurer pulls your MVR.

What happens if I get a ticket out of state?

Expect it to show up on your record.

Most states have reciprocal agreements that automatically share information on citations. The Driver’s License Compact has been signed by 45 states and Washington, D.C. Georgia, Massachusetts, Michigan, Tennessee and Wisconsin are not members, but they share and receive information just the same.

If your driving privileges are suspended in a state you are visiting, your home state typically will suspend your license as well.

Some states may not assign driver’s license points to out of state convictions, especially minor ones. But insurance companies will rate you on a violation no matter where it occurred, if it appears on your MVR and is considered a surchargeable offense.

4 ways to fight a speeding ticket

If you keep a ticket off your motor vehicle record, your insurance company cannot rate you on it.

Contest the ticket: You are pleading not guilty. You will need to notify the court that you want a contested hearing. Typically you will be offered another chance for mitigation or a deferral.

You can go to court yourself or hire a traffic attorney. If you are accused of a major violation such as a DUI, you should hire a lawyer.

If you win, the charge is dismissed and will not appear on your MVR. If you lose, the penalty will stay the same and the conviction will appear on your record, and you may have to pay court costs as well.

Ask for mitigation: You are pleading guilty but offering an explanation. The court may reduce the fine, but the conviction would go on your record. In some states, though, the judge may amend the charge to a non-moving violation, or you may have the option at this point of seeking a deferral or defensive driving class.

Seek a deferral or defensive driving class: You are pleading guilty but asking to have the conviction deferred. If you complete a class or go a certain period of time without another violation, the charge will not appear on your MVR. Typically you will pay a fine and fees that are as large as or even larger than you would have under the original violation, but your record will remain clear and your insurance rates will not rise.

You must contact the court before your appearance date to ask about these options.

Some jurisdictions will not offer deferrals or traffic school for certain violations, such as school- and construction-zone tickets or extreme cases of speeding.

Limit the damage: If a conviction on the original charge seems inevitable, you might want to ask for a continuance to delay a conviction past your next renewal date. In addition, a defensive driving class, even taken after the fact, can remove points from your motor vehicle record. While it cannot erase a conviction from your insurance company’s calculations, the class might bring a discount that softens the blow from the surcharge.

Methodology

Insurance.com analyzed more than 490,000 auto insurance quotes provided to Insurance.com users from 14 carriers, comparing quotes given to drivers with the 14 most common infractions recorded to quotes given to drivers with no violations. We used a model to estimate the annualized premium expected for certain combinations of personal attributes (residence, state, time with prior carrier, marital status and age) along with 14 violations. This ranking is not inclusive of all possible driving violations. Rates shown are averages; your own rate will depend on your personal factors. State laws governing traffic violations are subject to change.

Insurance.com commissioned Quadrant Information Services to gather rates comparing a driver with a clean record to a driver with certain violations from six major carriers in 10 ZIP codes in each state. Rates were returned on sample driver, male, 40 years old, single, a homeowner, driving 12 miles each way to work in a 2014 Honda Accord LX, for 100/300/50 liability coverage, collision and comprehensive coverage with a $500 deductible, uninsured motorist and additional mandatory coverages as required in each state.