Duplicating House Keys

by nrp, published

Duplicating House Keys by nrp May 30, 2011

Featured Thing!

4 Share
Download All Files

Thing Apps Enabled

Order This Printed View All Apps



Duplicating House Keys by nrp is licensed under the Creative Commons - Attribution license.

Use This Project

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

Print Thing Tag

Thing Statistics

56724Views 5312Downloads


Full writeup on my blog at: http://eclecti.cc/hardware/physical-keygen-duplicating-house-keys-on-a-3d-printer

It occurred to me recently that I had printed almost nothing actually useful on my RepRap 3D printer, aside from parts to improve on or build more RepRaps. I am rectifying that with this project. The goal here is to generate working house keys by inputing the key code of the lock into a parametric OpenSCAD model. Instead of having to explain to my landlord how I ended up with a wedge of plastic jammed in my front door, I ordered a box of (well) used locks and latches from eBay to experiment on. Luckily, the lot includes both Kwikset KW1 and Schlage SC1 locks, which are the two most commonly found in the US. I created an SC1 model to start with, but I’ll probably make a KW1 soon.

EDIT: I uploaded a KW1 model as well.

Designing the key model was actually pretty straightforward. I measured a key with a ruler and calipers and created an approximate model of it that is reasonably easy to print. I then got pin depth specifications and parametrically differenced them out of the model. To generate new keys, you can just edit the last line of the file and enter in the key code for your key. If the code isn’t written on the key, you can measure the height of each bit and compare to the numbers in the Root Depth column on the aforementioned pin depth site. Perhaps more nefariously, you could implement something like SNEAKEY to generate key codes without physically measuring the key.


You’ll of course need OpenSCAD to edit the .scad file and generate an STL to print out, unless your key just happens to be 33172 like the example STL posted below. If it is, you can unlock the doorknob currently sitting on my desk. As a small, precise object, this is a great test of how accurate your Skeinforge settings are. You may need to adjust some thicknesses or the built in pin depth fudge factor to get it working properly with your printer. The pictures above show the key being used on a disconnected lock cylinder, but I found it was also strong enough to turn a deadbolt. If your lock needs a lot of force to turn, you may need to cut a space into the key to use a torsion wrench with it.

All Apps

3D Print your file with 3D Hubs, the world’s largest online marketplace for 3D printing services.

App Info Launch App

Auto-magically prepare your 3D models for 3D printing. A cloud based 3D models Preparing and Healing solution for 3D Printing, MakePrintable provides features for model repairing, wall thickness...

App Info Launch App

Kiri:Moto is an integrated cloud-based slicer and tool-path generator for 3D Printing, CAM / CNC and Laser cutting. *** 3D printing mode provides model slicing and GCode output using built-in...

App Info Launch App
KiriMoto Thing App

With 3D Slash, you can edit 3d models like a stonecutter. A unique interface: as fun as a building game! The perfect tool for non-designers and children to create in 3D.

App Info Launch App

Print through a distributed network of 3D printing enthusiasts from across the US, at a fraction of the cost of the competitors. We want to change the world for the better through technology, an...

App Info Launch App

Quickly Scale, Mirror or Cut your 3D Models

App Info Launch App

3D Print a wide range of designs with Treatstock. Easy to use tools to get the perfect result. The global 3D printing network that connects you with high-quality and fast working print services nea...

App Info Launch App

Thank you for a key that I can sell, I personally like this one http://www.thingiverse.com/thing:52761 much better, but he won't let me sell it, so this one still gets a thumbs up.

Customizable House / Padlock Key
by Belfry
Mar 25, 2017 - Modified Mar 25, 2017

Could you make this customizable? I can't use OpenSCAD if my life depended on it.

I don't use OpenSCAD either but it was very easy to change the numbers to match my key. Download the file, open it in OpenSCAD and on the last line there is a group of numbers -- kw1([1,3,3,2,3]);. Change them to match your key and export the stl file. It's that easy. The hardest part will be determining which direction to read the pins. Just compare the exported file to the original key before printing and that problem is solved too.

Hmm, thanks, but when I opened it up in there, I can't seem to get it to show me what you want me to see.

You might want to try opening the scad file in a text editor like gEdit or notepad to change the relevant information and then opening it with OpenSCAD to export the STL. Might be easier than digging through the OpenSCAD interface.

Got it to work, but the key doesn't work.

Worked for my lock straight off the printer. I've tried several other "keys" from Thingiverse and they all failed -- they were each off in a small but significant way that kept them from working. Thanks for the design!

I've tried one other one, and it worked fine, but it broke, even when I printed it in ABS.

This is great work. Took me a bit to get the key measuring part down, really is unrelated to the fine work done here. Once I figured out the codes, the key works great. One note, for a standard Kwikset type like and similarly keyed generics, the key fits fine. For the Kwikset smart key lock, although the metal keys fit fine, the 3d print is too thick. I would love to see a slightly thinner key that would fit in these locks but I'm not sure if the printers or the material can do this. Thank you for this.

Impressive and terrifying all at the same time.

Nice work . i was impressed that it went right in to a rim cylinder i had sitting on my desk with little effort

Worked perfectly! Awesome OpenSCAD project.

I finally have a working 3D printer and decided to print out a key to my house using your model. Worked perfectly.

I tried to print one and it printed too sparse. What would you recommend as print settings(shells, solid layers, infill solidity)??


I print it entirely solid with 1 extra shell.

So, infill solidity should be set to 1.0?


I think you got the KW1 depth_inc = mm(.023) out by 0.001 mm should be .022. Going off some documention. Everything else seems good.

I was going off of the numbers here: http://web.archive.org/web/20050217020917fw_/http://dlaco.com/spacing/tips.htmhttp://web.archive.org/web/200...

That shows a 0.023" increment in depth.

I was just going off a 2006 version of instacode. It has a lot of information on a lot of keys. I'm new to OPENScad and currently trying to work out how to work it so I can slightly alter one of your key files to make it universal for lots of different keys by entering the details off instacode, spacing etc.

change your lock you've just given every one your house keys

No, only the doorknob currently sitting on his desk :-P

Rather than using the 3D printed key directly it could be used as a new duplication master. Unlike duplicated keys, a 3D printed one doesn't accumulate errors from previous generations.

Have you seen Daniel Bejar's visualization of key-duplication loss?

Or you could just attach that dremel to your Makerbot and mill your key.

couldn't you burn the key if it got stuck in a lock?

Yes, if you're not worried about arson. ;)

Your best bet is probably to take the lock apart and push the key back out the front with a small spudger.

Given that the script are parametric it should be trivial to make a bump key for most major locks. Just set every tooth to the maximum. (Or was it minimum?)

A bumpkey will work as long as it is cut below the lowest lift in that particular lock.

So if you had a key with only #1
amp; #2 cuts (rare, but I've seen them) a bumpkey cut to #2.5 or #3 would work. One cut of a #3 depth would make life impossible for that bumpkey.

Best bet is to get a proper lock, really. US locks are generally rubbish, and the weak backsets supplied are a liability. Try and get yourself a UK British Standard lever lock. Not one in ten locksmiths in your area will have the first clue how to open it, and it will stop a crowbar or boot far be
tter than a tatty little locking knob handle or even a deadbolt. Plus it can't be bumped!

Maximum bit depth, so minimum size of the key. I'm not sure it would work very well as a bump key. The plastic key is I think more inelastic than a normal brass key. Worth trying though.

Ok so my next question would be what is the maximum bit depth setting in your script? From hte included key it would seem like all 3's would create a bump key but your key may not have the maximum bit depth for any of the teeth... In other words what is the range of values for your bit depth on a kwiqset lock?

Yet another reminder that security systems don't stop anyone just delay them. Cool idea though

Hahaha. Security systems stop lots of people every day!

What you mean is that the average security system doesn't stop someone determined enough to put hours into it. Which is true. Most security systems can be broken with a bit of effort - that's what a good locksmith or pen tester will do.

However, if you want something impenetrable, you need to spe
nd a bit of money. And have a couple of guards and several layers. And even then, with enough time and resources, you still won't be safe! The CIA or whoever have an infinite resource to put against you, so without serious money to resist, you are stuck.

But to the average hacker/thief/locksmith?
Hardly the same thing.

When assessing security, always determine if there is a specific, targeted risk factor.


I was measuring my house key last night after a friend suggested I try and print one!

I gave up... glad to see you didnt.

TheRuttmeister: An easier way to duplicate a key might be to put it on a white piece of paper, photocopy and scan the copy or take a picture, scale to proper size, use Inkscape to convert to DXF, import into OpenSCAD, extrude, perhaps add some details, and print!

Keyway shapes are intentionally pretty complex, and even more so when modifying them to be printable while still fitting properly. It is really in all likelyhood going to be easier to just measure the dimensions of the key with a ruler or calipers, and modify either the kw1 or sc1 scad file to whatever key type you're looking to copy.