The Migratory Nerd

Travel tips, destination guides, reviews, and the occasional ramblings of world traveler & WordPress developer Duane Storey

Get my FREE BOOK and learn how to earn at least one free vacation ($500) every year - FIND OUT MORE »

How To Reprogram Keys And Fobs On A Mazda 3

Posted by in Tips :: Updated on :: 47 Comments

Not that long ago I lost my only accessible set of keys to my Mazda 3 Sport. I have a spare set somewhere, but thought at the time that they were probably buried in the back of my storage locker in Chilliwack. Going out to Chilliwack to get them may have been an option if, you know, the key to the storage locker wasn’t also on the same keychain that was lost. Ultimately I had to tow my car to Mazda and get them to give me two new keys, both of which were entered into the onboard computer to allow them to actually start the car.

Since that time I’ve reclaimed the set of keys that were lost as well as my spare set of keys. That’s great in that I now have all those items back, but unfortunately neither the FOBs (the wireless units that open and close the doors) nor the keys work with my car anymore, since the onboard computer has been reset for the new items.

If you take them to a Mazda dealership, they will often charge to program the keys and the FOB, or so I’m told. Instead, I decided to scour the internet and eventually found instructions buried on a forum for how to do it.

For future reference, here is how you reprogram keys and FOBs for the Mazda (I believe it’ll work for the 3 and the 5, and possibly others).

Reprogram Keys

To allow a spare key to start the car, you need to start out with two working keys for the Mazda. This is security precaution to make sure someone with one key can’t activate another one, for example, a valet who has the key. If you only have one key, you’re out of luck and will have to take the car to Mazda to have it done. In fact, many people recommend buying a spare key and doing this procedure so that you always have three working keys around (you only receive two when you buy the car). That way if you lose one, you still have the ability to do this procedure on your own.

Here is how you do it:

  • Insert the first working key into the key slot and turn the ignition to ON. Wait about 5 seconds, then remove the key.
  • Insert the second working key into the key slot and turn the ignition to ON. Wait about 5 seconds, then remove the key.
  • Insert your new/spare key into the key slot and turn the ignition to ON. Wait about 5 seconds, then turn to OFF. This should add that key’s information to the onboard computer and allow it to start the car.

How To Reprogram the FOBs

This procedure is a bit more involved, and it reminds me a bit of the Konami Code from Nintendo. You’ll need access to all the FOB units that you want to enable for the vehicle. Apparently you can only have three active FOBs at the same time, so don’t try and program more than that.

  • Open the driver side door
  • Lock and then unlock the door using the button on the door. Leave the door open.
  • Insert a key into the ignition and turn the car to the ON position. Leave for about 2 or 3 seconds, then turn off. Repeat this two more times (3 in total). Leave the key in the slot in the OFF position.
  • Close the driver’s door. Then open it. Then close it. Then open it. Then close it. Then open it.
  • The onboard computer will respond by locking and unlocking all the doors at this point. That means it’s ready to accept FOB programming
  • Press a button on each FOB unit to program it to the computer.
  • When you are done programming FOBs, you can simply remove the key, which causes the computer to cycle the door locks once more.

I did both of these procedures in under five minutes, and now have four working keys and three working FOBs. So if you are in the same scenario and are feeling a little adventurous, you can simply reprogram the keys or the FOB yourself and save both time and money.

Where To Buy

I’ve tracked down a few links if people want to buy FOBs online.

For key blanks, here seems to be one that works with most models:

Related Posts

47 Responses to “How To Reprogram Keys And Fobs On A Mazda 3”

  1. Tim says:

    Great article — what year is your Mazda 3 ? Thanks!

  2. Tim says:

    Thanks! I have a 2011 and wanted to make sure they are close enough in model years for this to work. According to keys selling on Ebay it seems the 2005 to 2011 models may be able to use the same key fob. Again, thanks for taking time to help others with the programming!

  3. Jean says:

    I have a 3012 Mazda 3.
    It came with 2 switchblade keys/fobs. I have purchased a valet key on ebay. If I just want to program the valet key – do I follow the directions to reprogram the keys or the fobs or some combination of both?

  4. Adam says:

    Jean – you only need to do the following :
    Insert the first working key into the key slot and turn the ignition to ON. Wait about 5 seconds, then remove the key.
    Insert the second working key into the key slot and turn the ignition to ON. Wait about 5 seconds, then remove the key.
    Insert your new/spare key into the key slot and turn the ignition to ON. Wait about 5 seconds, then turn to OFF. This should add that key’s information to the onboard computer and allow it to start the car.
    BUT In order for this to work, your valet key must have a transponder in it. It’s a 4D63 transponder which looks like a piece of carbon. Some do and don’t come with it on ebay. Tried it myself and works

  5. kevin says:

    on 2012 i had to follow the directions three times. put the key in one way, then the and then one ast time. each time the key gets closer to programmed. first time no key turned and then it turned as long as it was in front words, then the second time front or back but car wouldnt start and the third time the car started and key was completely programmed. all this cost 40 dollars. the dealer wanted close to 400, like 350 for everything, do it yourself.

  6. Tony says:

    I’ve tried this key fob programming procedure several times. The on board computer never responds. Is there some trick to doing this? I have an 04 Mazda 3. Any help would be appreciated. Thx.

  7. Carmen says:

    Just wanted you to know this works on a 2013 Mazda 3. But your directions have “passenger door” when you meant drivers door, which may be why some people did not get it to work.

  8. Thanks, I updated the post.

  9. T*Pow says:

    This website comes up early in Google searches for reprogramming Mazda3 keys and fobs. One important detail I discovered when reprogramming my 2007 Mazda3 fob: you need to press a button on the fob twice per fob, not just once. The locks will cycle after the second button press to signal that the fob has been accepted, and then you move on to the next fob. If you only press the button once, the system will not accept that fob, nor will the pre-existing fobs be erased from memory.

  10. Brad says:

    I am going to install a new ignition cylinder lock that comes with two new keys.Does anyone know if I have to reprogram the keys and ecu and if so what about the fob.Can this be done by me or are the dealers going to have to be involved.This is a 2004 Mazda 3.

  11. Marc-Andre says:

    Mazda 3 2010

    I just tried the FOB programming, after I bought one on eBay.
    Worked like a charm.
    I had to press ONE button on first FOB (the working one), and twice on the new one.
    I think that if we press a button twice, on one or the other, this ends the procedure … by locking and unlocking doors.
    I went to a locksmith to have the key cut for 10$.

    The only problem I have now is that I only have ONE working key (both FOB’s working).
    I will have to go to Mazda for this part

    Many thanks for the post !

    Marc-Andr

  12. nrpardee says:

    The above keyfob procedure did not work on my 2012 mazda3, but this did:
    •-close doors, then open driver door
    •-insert working key fob in ignition, then turn to on, then off three times (no wait required). Leave in ignition
    •-close, then open driver door three times (leave open)
    •-press the lock, then the unlock button
    •-press the unlock button twice on ALL the fobs you want to use (including the one that works)
    •-toward the end you’ll start getting some lock, unlock sequences. Just ignore them, but if you don’t get them, something went wrong.
    •-try your remotes

    You will also need to reprogram the key, and that took 4 or 5 tries for me- couldn’t figure out why.

  13. nick says:

    I bought a key from dx.com, which said it was for M3/M6 but with the 4D chip (supposedly). I had it cut and tried to program it as above. Doesn’t seem to work however.

    Since I’m having problems, I’ve been examining the (simple) instructions carefully looking for what I’m doing wrong. In steps 1) and 2), you can’t remove the key somehow without turning to OFF right? I’m not crazy right? You turn to OFF and then REMOVE the key, and the instructions don’t mention that because it’s obvious, I’m assuming.

  14. Nelson R. Pardee says:

    Yes, you turn to off & then remove.
    Leaving for five seconds may not be the correct value- in fact, five seconds may be the max allowed. From experience, and reading on other sites, anywhere from 1-5 seconds seems right. Actually, it appears that you leave it on until the red warning light in the display goes off- then remove. So
    – good key in, turn on, wait for red light to go off, turn off, remove
    – second good key, repeat
    – new key, repeat (but don’t have to remove- go ahead and try it)
    There may be a five second maximum between keys, as well.
    In general, it seems to take people multiple tries to get this to work.
    Let us know how it goes.

  15. SS says:

    Hi, so I get the point of having two keys to program a third spare. My question is that if you lose your spare how do you disactivate the lost key from your system as this procedure is only for programming new keys.

  16. @SS – I suspect that if you want to wipe the lost key out of the compute then you probably have to visit Mazda and have them remove that key’s transponder code from the computer.

  17. ss says:

    Hi again, so I guess when you programm a spare – third key, it doesn’t delete the lost key you had previously? Cheers

  18. Nelson R. Pardee says:

    Correct. The lost key will continue to work. You have to decide if you think it’s likely that someone would find the key and associate it with your vehicle AND do something you wouldn’t like.

  19. bruce says:

    just bought a 2011 mazda 3 2.5 i had received 2 keys but one will not start the car but the other one does. is there a key code that i could do to set the second key without going to the dealer to have it done? please let me know. thanks

  20. @Bruce – Unfortunately not. You need two working keys to program a third. If you just have one you can’t reprogram it yourself. This is meant as a security precaution in case you were to give your keys to someone else like a valet at a restaurant – they can’t make a copy of the key with just one. So unfortunately you will have to go to the dealer.

  21. Nelson R. Pardee says:

    @Bruce- to add to what Duane wrote. After getting the second key programmed, get a third key, which you can then program yourself. Then, if you lose a key, you won’t be back to one key and getting a new one programmed by a dealer. The least expensive place to get another key is on ebay, either just a key or a key+remote (used remote is fine. buy a key blank and have it cut by a locksmith). If you don’t have a remote and you might want one, then I’d recommend getting a key/remote combination and having them programmed together- it’s probably cheaper. Then you can program additional keys and remotes yourself (it only takes one remote to program another remote).

  22. @Bruce/Nelson – Agreed, definitely check out eBay for a key. If you’re lazy I also have a few links to the keys and FOBs on Amazon as well above.

  23. Justin says:

    Duane and the gang,

    I have a 2010 Mazda 3 and I recently bought a new keyless remote fob for it on ebay, brand new never used with an uncut key. I am trying to program the remote before I go ahead and get the key cut. I tried your method, which I have seen on a variety of other Mazda blogs and it did not work for me. My problem is, I do not have an unlock/lock button. I’ve been manually unlocking and locking the doors myself for the past year that I’ve had the car and finally went ahead and bought the wireless remote fob. Does me not having an unlock/lock button mean that I don’t have automatic locks? Will this method still work if I’m not able to do the unlock/lock step in your instructions? Do I have to take my car to Mazda? Any help would be greatly appreciated. As far as I know the previous owner did have a wireless key fob for the car, but lost it. Any guidance would be greatly appreciated.

    Thanks,
    Justin

  24. Nelson says:

    @Bruce- one correction. The dealer shouldn’t have to do anything to program the wireless remote- you just need one working key. This is assuming your car has power door locks installed. Here’s what I should have written (Duane- any chance of replacing what I wrote above?)

    @Bruce- to add to what Duane wrote. After getting the second key programmed, get a third key, which you can then program yourself. Then, if you lose a key, you won’t be back to one key and getting a new one programmed by a dealer. The least expensive place to get another key is on ebay, either just a key or a key+remote (used remote is fine. Buy the special key blank for the remote and have it cut by a locksmith). You’ll then be able to program additional keys and your remote- remember, programming a remote means programming both the remote and the key that’s part of the remote. (you can actually program the remote with a single key, but you won’t be able to program the key on the remote without having two working keys) CAVEAT: you must have power door locks in your car to use the remote. If you didn’t receive a remote with the car, you’ll want to verify that it actually works with a remote- I think all it requires is power door locks, but there might be something else- some circuitry enabled, etc.)

  25. Nelson says:

    @Justin- you need to have power door locks in order to use a remote. I did some quick Googling, and if your car doesn’t have power locks, people have added them and any additional stuff required, but it’s not cheap. Sorry if that’s bad news

  26. Josh Ashworth says:

    So let me tell you all about my experience and story with what i have now dubbed, “the key fiasco”. I managed to lose the only key I had to my car on a trip to watch Notre Dame & Oklahoma play. It was a long day on a party bus and then planting my butt on a bleacher seat, and my keys somehow fell out of my pocket. My backup or “spare” key got lost in my move from Cincinnati to Indianapolis, so I was SOL!

    My car (2011 Mazda 3 S Sport) was parked in a Meijer parking lot (where the part bus picked me up) under a light in a pretty safe area. I didn’t realize I didn’t have my keys until we got back to the parking lot Saturday night. After an exhaustive search of the party bus, I realized they were a goner. Since all Mazda dealerships are closed on Sunday in Indianapolis, I was SOL. My search for resolution began.

    The dealership wanted to charge me up around $375 – $450 plus the cost of towing to cut me one new switchblade key with FOB!!! Needless to say I wasn’t thrilled and new that there had to be a cheaper way. I started going round and round looking for locksmiths or anyone else who can help me.

    I ran into a company called High Tech Locksmith (hightechlocksmith.com) who said they could do everything right there in the parking lot from their mobile van. I did some research and they were nationwide and a pretty reputable company. Great BBB reviews and local reviews were great too. I called the guy and he quoted me $160 for 2 basic (non switchblade – without keyless entry fob) keys. That was the price for programming, key cuts, keys, and everything out the door. At this point I had done my research and knew that in order for me to get anywhere, I needed 2 keys and the price seemed like the best I was going to get for price. I set the appointment for Tuesday afternoon.

    The guy from High Tech Locksmith showed up and it was one of the most impressive and fascinating things that I have ever seen. First he was able to use the pillow and door hanger trick to get my door open. From there he checked my ID and my registration to make sure it was indeed my car. Next, he popped off a cover from the inside of my driver side door seal and unscrewed the housing that held my actual handle in place to the outside of the door. He then pulled my handle out of my door and on the inside of my door, sure enough, my 5 digit key code needed for cutting and stored in the Mazda database. He then went back into his van and typed this code in and within 2 minutes had 2 brand new keys cut that would lock and unlock my doors and also turn my ignition, but not start the car (programming was still needed). Next he pulled out a tablet looking device that had a cable and plug attached to it. He plugged the female end of the cable into a socket next to the kick panel on the driver side. Typed on the tablet, put the first key in, programmed it. Put the second key in, programmed it. Next thing I know he turns the ignition, and boom… MY CAR STARTED!!! He had everything cut, programmed, complete, put back together (remember he popped my door handle off), and good to go in less than 9 minutes!!! I was fascinated!

    So now that my initial crisis was over, it was on to find a key fob so I could still utilize my keyless entry part of my car. On EBay I was able to find a switchblade key fob (like new – used) with a blank key blade for $39.99. I was skeptical of it because the dealer wanted to charge $290, but thought it was worth a $40 gamble. They key came in two days and the only way I could tell it was used was because the trunk release button was faded. I first decided I would try programming the keyless entry function to see if it would accept and unlock my doors. The programming steps listed here were pretty easy to follow.

    I found that you need to do these steps in no more than 20-25 seconds for the sequence to be accepted and be able to be programmed. It took me 3-4 times to get it right, but by the time I did, it was obvious that I did it right (the lock cycling back and forth and everything).

    At this point I had a working fob, but still had the plain old key blank. I wanted to avoid carrying both the switchblade fob with blank key and the basic key the locksmith cut me, so I was out to get my key blank cut. I set off for the Mazda dealership and got back to the parts counter. I told my sob story of what happened with my key and told the guy at the parts desk what I wanted to do, and he cut the key blank on the switchblade fob for free!! He did however tell me that I would have to pay for programming. Since I already had figured out the programming sequence, I told him it wouldn’t be necessary but would appreciate the free cut. He did ask me if I had the key code, as its always better to cut off the code rather than just duplicate my key. I had wrote the key code down from where the locksmith popped my door handle off, so I was good to go. He cut my key and handed it to me and told me good luck with programming. I went out to my car and had my 2 “basic” transponder keys, so programming a third was going to be easy. I followed the steps listed on this site.

    After doing that (in the parking lot of the Mazda dealership), I was done. I now have 2 “basic” transponder keys that will manually lock/unlock my doors and start my car, and one switchblade fob with will keylessly lock/unlock my car and start it.
    I was very confident in the procedure so I decided to buy another switchblade FOB online so I would have a spare and 4 working keys. I’m waiting for that to come in the mail. Once I have that, I will post a video that shows how to program both.

    Overall, it was a $250 adventure for 2 basic keys and 2 fob keys all created from scratch. Not too bad considering what the dealership wanted to charge!!

    Hope this helps!

  27. @Josh – My mishap happened after Canada Day here in Canada, which is a huge all night party basically. I somehow lost my keys to my Mazda that night (as well as my Digital SLR camera). Because it was on my only key to the car, I had to tow it to the Mazda Dealership in North Vancouver. I have a shock sensor on my car, so it was blaring the entire 30 minute trip. When I finally got there they cut me two new keys and gave me two new fobs, but I think it still cost me $400, plus around $100 for the tow truck. It was an expensive night of drinking, let me tell you!

  28. Jessica says:

    Does the programing of FOB also reprogram the keyless entry for the trunk?

  29. Julio says:

    Hi Duane, Im in Vancouver and I just bougth a 2006 Mazda 5, the car came with a old FOB and I went ebay for a new one.
    I did the programing by myself and now I want to know how to program the key (the open/close programing DONE)
    Do you know how much it cost at the dealer?

  30. Paul says:

    Is there a way to do this with a newer Mazda with Push Start?

  31. Larry says:

    We just bought a Mazda 2012 for my son. Since there 3 of us, we needed a third key. Dealer said to go to hardware store for a third key – wrong, their blank didn’t have a chip. Then I researched and found this website. Thanks for the post.

    First blank was from NJ365 but turned out to be poorly made and too thick. After hardware store cut it and I used a dremel to deepen the notches and skinny it down, it finally unlocked the door. After 3 tries with 2 original and 1 new key, the programming took. Then bought another blank from WeGotRemotes on Amazon and blank was perfect. After cutting, the programming took after first try.

    We are now all set in case a key is lost. Thanks again for the post.

  32. Robert says:

    On the step where you (press a button on each FOB unit to program it to the computer.) Does this mean you press the unlock, lock, and panic button on the remote lock or just one button.

  33. Robert says:

    Do you press just one button or all 3 buttons on the second to last step on the remote lock?

  34. Drew says:

    Just bought my son a 2009 Mazda 3 after he got his license. He absolutely loves the car. We had both original keys. So I ordered 2 blank keys off of eBay and had them in 2 days. Took them to the Ace Hardware and had them cut. They were reluctant to cut them because they said they were no liable if they were cut wrong. I assured them that I would not hold them liable if they messed up the cuts. After they cut them I followed the above directions and now have 4 working keys. This saved me about $350 from the dealer. Thanks.

    Only thing I had to do to get 4 versus 3 keys was to follow the above procedures for Key 3. Then follow the above procedures for Key 4 with using all three good keys and then the 4th key.

    I do have a question. The car do not come with a Key Fob. Do you need 1 working to get this procedure to work? His car did not come with a remote. Second question I followed the above procedures and the computer responded by unlocking the locking the doors. Here is the question – Does this mean that keyless receiver is installed in the vehicle?

    Thanks – Drew

  35. Fran says:

    Found your website, it’s the first result on the web search. 2010 Mazda 3 and your key programming went flawless, but your fob programming didn’t work. I followed “nrpardee” directions for his 2012 and that worked perfectly. You should add that to the top as well. And thank you, you saved me a trip to the dealer and allot of $$$

  36. Stuart says:

    Does anybody know how to program an extra fob for a 2014 Mazda3 Advanced Keyless Entry System.

  37. Joseph says:

    I had my Mazda 3 1.6 2007 engine redone but someone stole my ECU/PCM.To cut the long story short,I need to know if after buying a salvaged ECU for my car what must I do to make the new ECU accept my keys?

  38. Richard Bruer says:

    The detailed procedure below I eventually found in my 2012 Mazda 3 Service Manual in the Body and Accessories -> IMMOBILIZER SYSTEM-RELATED PARTS PROGRAMMING [KEYLESS ENTRY SYSTEM] section may be helpful to explain why some are having trouble getting keys to be programmed.

    Additional Key Programming Procedure (Using Two Valid Keys)

    CAUTION:
    – The engine cannot be started if any step or procedure is skipped. Perform all procedures in the order of the steps.

    CONDITIONS:
    – Have two or more valid keys.

    NOTE:
    – If a key ID number cannot be programmed and DTC 15 is displayed, the maximum number of programmed keys may have been reached. Verify the number of programmed keys using the M-MDS (IDS).
    – If eight keys have already been programmed and it is necessary to program other keys, the previously programmed key ID numbers must first be cleared.
    – If “Customer spare key programming disable” is selected, perform additional key programming using the M-MDS. (See “Additional Key Programming Procedure (Using the M-MDS (IDS))”).

    PROCEDURE:
    – Valid Keys: key 1, key 2.
    – Key to be programmed: key 3.
    1) Switch the ignition to ON using key 1.
    2) After verifying that the security light illuminates for approx. 3 s and turns off, switch the ignition off within approx. 4 s using key 1.
    3) Remove key 1.
    4) Switch the ignition to ON using key 2.
    5) After verifying that the security light illuminates for approx. 3 s and turns off, switch the ignition off within approx. 4 s using key 2.
    6) Remove key 2.
    7) Switch the ignition to ON using key 3.
    8) Verify that the security light illuminates for approx. 3 s, and then turns off.
    9) Remove key 3.

  39. Dave says:

    Duane

    I bought a new key fob fir my sisters 2010 Mazda 3 Touring. She lost her original key fobs. She has only one key left. I bought a new key fob for the Mazda and will follow your directions on programming the fob. The new switchblade fob has not yet had the key blank cut.

    My question is, using the only key remaining when I program the new fob, will it deactivate the chip in the lone key?

    Thx
    Dave

  40. Persia says:

    Recently bought a used Mazda 3, 2005, with only one fob (separate from the key). Bought another fob, correct model, on eBay, followed the sequence above and it worked fine. Then checked my original fob and it no longer worked. Reprogrammed the original, the new one n longer worked. Tried once more on this one, noe both don’t work and won’t respond to be reprogrammed. Help! Any ideas welcome.
    Persia

  41. Pete Murgatroyd says:

    Hi Duane
    Wonder if you could help me please? Have followed your procedure on my Mazda 6 (2011) – with the exception of locking the doors via the driver’s door – the car will not allow locking of the doors if a door or the trunk is left open.
    During and after the procedure, the locks respond by locking and unlocking a few times, but the remote still fails to work.
    Any ideas please?
    Many thanks
    Pete.

  42. Pete Murgatroyd says:

    Hi Duane – its me with the Mazda 6 – just spotted the red light on the remote wasn’t lighting up – I’d put the battery in wrong way round – Doh!
    Everything working ok now!
    Pete

  43. David says:

    Ok so you need both keys to program a third key. Do you need both fobs as well? I had two fobs but one is not working anymore. Can I use my remaining one to program a new one?

  44. Joe says:

    Ok, so I bought my 2005 Mazda 3s back in April and they said it has keyless entry but yet it did not come with a key fob at all. Before ordering a fob online, I called the local Mazda dealer and they verified that I have keyless entry. I can get the car into programming mode in a matter of seconds. When I hit a button on the fob, it doesn’t respond at all. So I ordered a second remote thinking I bought a dud..still nothing. Sooo I pulled down the map light and took out the Keyless Entry Module and matched it up to the remotes serial number, so I know that’s right. I bought another Module and I still can’t get these remotes to program at all. Has anyone else had this issue? After reading through several websites, I seem to be the only person who has the car in programming mode but yet can’t get the remote to respond even after replacing the Keyless module and buying two remotes. Is there another part that affects the Keyless programming

  45. Persia says:

    I had similar problems – two fobs that wouldn’t respond to any process. I tried this; re-programing the Mazda 3 ECU, the computer on board – which gives limited access to new fobs. To do this, and wipe its memory, remove the negative connection to the battery, then press the brake pedal to use up remaining charge in the system. At this point the ECU forgets its previous history and is open, when the battery is reconnected, to new fobs.
    It was easy and worked for me immediately. It’s way outside of my experience, and I have no idea if it will solve your problem, but it does sound similar.
    Good luck!

  46. Z says:

    I have a bit of an unusual situation. 2011 Mazda 3. I have 2 working key FOBs. We have had a string of “break-ins” on our car with no sign of forced entry. Not just us, but many people in the neighbourhood, which has led me to believe that someone in the area has a device which can record the keyless entry signal and use that to unlocks the cars (yes, this exists, Google it). Therefore I would like to re-program the two keys I already have with a new code and from then on we will not use the keyless entry system (and not broadcast the signal) when we are at home.

    Could I follow this procedure to simply assign a new code to our two existing FOBs (no 3rd key involved)?

Leave a Reply